Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(playground): extract playground UI into reusable @trycua/playground package (#1013)

Sarina Li48ca733da410
diff --git a/.github/workflows/cd-ts-playground.yml b/.github/workflows/cd-ts-playground.yml
new file mode 100644
index 0000000000..bf95bf8fc1
--- /dev/null
+++ b/.github/workflows/cd-ts-playground.yml
@@ -0,0 +1,83 @@
+name: "CD: @trycua/playground (npm)"
+
+on:
+ push:
+ tags:
+ - "npm-playground-v*"
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Version to publish (default: from package.json)"
+ required: false
+ default: ""
+ workflow_call:
+ inputs:
+ version:
+ description: "Version to publish (default: from package.json)"
+ required: false
+ type: string
+ default: ""
+
+permissions:
+ id-token: write
+ contents: write
+
+jobs:
+ prepare:
+ runs-on: ubuntu-latest
+ outputs:
+ version: ${{ steps.get-version.outputs.version }}
+ tag: ${{ steps.get-version.outputs.tag }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Determine version
+ id: get-version
+ run: |
+ # Check inputs.version first (works for workflow_call)
+ if [ -n "${{ inputs.version }}" ]; then
+ VERSION="${{ inputs.version }}"
+ elif [ "${{ github.event_name }}" == "push" ]; then
+ # Extract version from tag
+ if [[ "${{ github.ref }}" =~ ^refs/tags/npm-playground-v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
+ VERSION=${BASH_REMATCH[1]}
+ else
+ echo "ERROR: Invalid tag format for npm-playground"
+ exit 1
+ fi
+ elif [ -n "${{ github.event.inputs.version }}" ]; then
+ VERSION="${{ github.event.inputs.version }}"
+ else
+ # Read from package.json
+ VERSION=$(node -p "require('./libs/typescript/playground/package.json').version")
+ fi
+
+ echo "Playground version: $VERSION"
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
+ echo "tag=npm-playground-v${VERSION}" >> $GITHUB_OUTPUT
+
+ publish:
+ needs: prepare
+ uses: ./.github/workflows/ts-reusable-publish.yml
+ with:
+ package_name: "playground"
+ package_dir: "libs/typescript/playground"
+ package_manager: "pnpm"
+ version: ${{ needs.prepare.outputs.version }}
+ secrets:
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ create-release:
+ needs: [prepare, publish]
+ uses: ./.github/workflows/release-github-reusable.yml
+ with:
+ tag_name: ${{ needs.prepare.outputs.tag }}
+ release_name: "@trycua/playground v${{ needs.prepare.outputs.version }}"
+ module_path: "libs/typescript/playground"
+ body: |
+ ## Installation
+
+ ```bash
+ npm install @trycua/playground
+ ```
diff --git a/.github/workflows/release-bump-version.yml b/.github/workflows/release-bump-version.yml
index e48b42e5b3..6019bce1e8 100644
--- a/.github/workflows/release-bump-version.yml
+++ b/.github/workflows/release-bump-version.yml
@@ -19,6 +19,7 @@ on:
- npm/cli
- npm/computer
- npm/core
+ - npm/playground
- npm/cuabot
- lume
- docker/cuabot
@@ -92,6 +93,8 @@ jobs:
echo "directory=libs/typescript/core" >> $GITHUB_OUTPUT
echo "type=npm" >> $GITHUB_OUTPUT
;;
+ "npm/playground")
+ echo "directory=libs/typescript/playground" >> $GITHUB_OUTPUT
"npm/cuabot")
echo "directory=libs/cuabot" >> $GITHUB_OUTPUT
echo "type=npm" >> $GITHUB_OUTPUT
@@ -354,6 +357,14 @@ jobs:
echo "npm/core version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+ - name: Capture bumped npm/playground version
+ if: ${{ inputs.service == 'npm/playground' }}
+ id: npm_playground_version
+ run: |
+ VERSION=$(grep -oP '"version": "\K[^"]+' libs/typescript/playground/package.json)
+ echo "npm/playground version: $VERSION"
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+
- name: Capture bumped lume version
if: ${{ inputs.service == 'lume' }}
id: lume_version
diff --git a/libs/typescript/playground/.bumpversion.cfg b/libs/typescript/playground/.bumpversion.cfg
new file mode 100644
index 0000000000..fa60c3ffd5
--- /dev/null
+++ b/libs/typescript/playground/.bumpversion.cfg
@@ -0,0 +1,10 @@
+[bumpversion]
+current_version = 0.1.0
+commit = True
+tag = True
+tag_name = npm-playground-v{new_version}
+message = Bump @trycua/playground to v{new_version}
+
+[bumpversion:file:package.json]
+search = "version": "{current_version}"
+replace = "version": "{new_version}"
diff --git a/libs/typescript/playground/package.json b/libs/typescript/playground/package.json
new file mode 100644
index 0000000000..797711e41d
--- /dev/null
+++ b/libs/typescript/playground/package.json
@@ -0,0 +1,74 @@
+{
+ "name": "@trycua/playground",
+ "version": "0.1.0",
+ "packageManager": "[email protected]",
+ "description": "Reusable playground UI for Cua computer-use agents",
+ "type": "module",
+ "license": "MIT",
+ "homepage": "https://github.com/trycua/cua/tree/main/libs/typescript/playground",
+ "bugs": {
+ "url": "https://github.com/trycua/cua/issues"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/trycua/cua.git"
+ },
+ "author": "cua",
+ "files": [
+ "dist"
+ ],
+ "main": "./dist/index.js",
+ "module": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "import": "./dist/index.js",
+ "types": "./dist/index.d.ts"
+ },
+ "./package.json": "./package.json"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "peerDependencies": {
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0",
+ "motion": "^12.0.0",
+ "lucide-react": ">=0.400.0"
+ },
+ "dependencies": {
+ "@radix-ui/react-dialog": "^1.1.15",
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
+ "@radix-ui/react-select": "^2.2.5",
+ "@radix-ui/react-slot": "^1.0.0",
+ "@radix-ui/react-tooltip": "^1.2.8",
+ "@zip.js/zip.js": "^2.7.0",
+ "class-variance-authority": "^0.7.0",
+ "clsx": "^2.0.0",
+ "lottie-react": "^2.4.0",
+ "react-markdown": "^9.0.0",
+ "remark-gfm": "^4.0.0",
+ "tailwind-merge": "^2.0.0"
+ },
+ "devDependencies": {
+ "@types/react": "^18.0.0",
+ "@types/react-dom": "^18.0.0",
+ "bumpp": "^10.1.0",
+ "lucide-react": "^0.400.0",
+ "motion": "^12.0.0",
+ "tsdown": "^0.11.9",
+ "typescript": "^5.8.3",
+ "vitest": "^4.0.14"
+ },
+ "scripts": {
+ "lint": "prettier --check .",
+ "lint:fix": "prettier --write .",
+ "build": "tsdown",
+ "dev": "tsdown --watch",
+ "test": "vitest",
+ "typecheck": "tsc --noEmit",
+ "release": "bumpp && pnpm publish",
+ "prepublishOnly": "pnpm run build",
+ "link:global": "pnpm link --global"
+ }
+}
diff --git a/libs/typescript/playground/src/adapters/cloud.ts b/libs/typescript/playground/src/adapters/cloud.ts
new file mode 100644
index 0000000000..3d4cdfacfd
--- /dev/null
+++ b/libs/typescript/playground/src/adapters/cloud.ts
@@ -0,0 +1,284 @@
+// Cloud adapter implementation
+// Uses CUA API for persistence, VMs, and inference configuration
+
+import type {
+ PlaygroundAdapters,
+ PersistenceAdapter,
+ ComputerAdapter,
+ InferenceAdapter,
+ CloudAdapterConfig,
+ ComputerInfo,
+ InferenceConfig,
+} from './types';
+import type { AgentMessage, Chat, ModelProvider } from '../types';
+
+// =============================================================================
+// API Error Helper
+// =============================================================================
+
+class ApiError extends Error {
+ constructor(
+ public status: number,
+ message: string
+ ) {
+ super(message);
+ this.name = 'ApiError';
+ }
+}
+
+// =============================================================================
+// Cloud Persistence Adapter
+// =============================================================================
+
+class CloudPersistenceAdapter implements PersistenceAdapter {
+ constructor(
+ private apiKey: string,
+ private baseUrl: string
+ ) {}
+
+ private async fetch<T>(path: string, options?: RequestInit): Promise<T> {
+ const response = await fetch(`${this.baseUrl}${path}`, {
+ ...options,
+ headers: {
+ Authorization: `Bearer ${this.apiKey}`,
+ 'Content-Type': 'application/json',
+ ...options?.headers,
+ },
+ });
+
+ if (!response.ok) {
+ let errorMessage: string;
+ try {
+ const errorBody = await response.json();
+ errorMessage =
+ errorBody.detail || errorBody.error || `HTTP ${response.status}`;
+ } catch {
+ errorMessage = `HTTP ${response.status}`;
+ }
+ throw new ApiError(response.status, errorMessage);
+ }
+
+ return response.json();
+ }
+
+ async loadChats(): Promise<Chat[]> {
+ return this.fetch<Chat[]>('/v1/playground/chats');
+ }
+
+ async saveChat(chat: Chat): Promise<Chat> {
+ if (chat.id) {
+ return this.fetch<Chat>(`/v1/playground/chats/${chat.id}`, {
+ method: 'PUT',
+ body: JSON.stringify(chat),
+ });
+ }
+ return this.fetch<Chat>('/v1/playground/chats', {
+ method: 'POST',
+ body: JSON.stringify(chat),
+ });
+ }
+
+ async deleteChat(chatId: string): Promise<void> {
+ await this.fetch(`/v1/playground/chats/${chatId}`, { method: 'DELETE' });
+ }
+
+ async saveMessages(chatId: string, messages: AgentMessage[]): Promise<void> {
+ await this.fetch(`/v1/playground/chats/${chatId}/messages`, {
+ method: 'PUT',
+ body: JSON.stringify({ messages }),
+ });
+ }
+
+ async loadSettings<T>(key: string): Promise<T | null> {
+ try {
+ return await this.fetch<T>(`/v1/playground/settings/${key}`);
+ } catch (error) {
+ // Return null if settings not found (404)
+ if (error instanceof ApiError && error.status === 404) {
+ return null;
+ }
+ throw error;
+ }
+ }
+
+ async saveSettings<T>(key: string, value: T): Promise<void> {
+ await this.fetch(`/v1/playground/settings/${key}`, {
+ method: 'PUT',
+ body: JSON.stringify({ value }),
+ });
+ }
+}
+
+// =============================================================================
+// Cloud Computer Adapter
+// =============================================================================
+
+// VM response type from API
+interface VMResponse {
+ id: string;
+ vmId?: string;
+ name: string;
+ customName?: string;
+ status: string;
+ vncUrl?: string | null;
+ vnc_url?: string | null;
+ agentUrl?: string | null;
+ agent_url?: string | null;
+}
+
+class CloudComputerAdapter implements ComputerAdapter {
+ constructor(
+ private apiKey: string,
+ private baseUrl: string
+ ) {}
+
+ private async fetch<T>(path: string, options?: RequestInit): Promise<T> {
+ const response = await fetch(`${this.baseUrl}${path}`, {
+ ...options,
+ headers: {
+ Authorization: `Bearer ${this.apiKey}`,
+ 'Content-Type': 'application/json',
+ ...options?.headers,
+ },
+ });
+
+ if (!response.ok) {
+ let errorMessage: string;
+ try {
+ const errorBody = await response.json();
+ errorMessage =
+ errorBody.detail || errorBody.error || `HTTP ${response.status}`;
+ } catch {
+ errorMessage = `HTTP ${response.status}`;
+ }
+ throw new ApiError(response.status, errorMessage);
+ }
+
+ return response.json();
+ }
+
+ async listComputers(): Promise<ComputerInfo[]> {
+ const vms = await this.fetch<VMResponse[]>('/v1/vms');
+ return vms.map((vm) => ({
+ id: vm.vmId || vm.id,
+ name: vm.customName || vm.name || `VM ${vm.id}`,
+ vncUrl: vm.vncUrl || vm.vnc_url || '',
+ agentUrl: vm.agentUrl || vm.agent_url || '',
+ status: this.mapVMStatus(vm.status),
+ }));
+ }
+
+ private mapVMStatus(
+ status: string
+ ): 'running' | 'stopped' | 'starting' | 'error' {
+ switch (status.toLowerCase()) {
+ case 'running':
+ return 'running';
+ case 'stopped':
+ case 'suspended':
+ return 'stopped';
+ case 'starting':
+ case 'provisioning':
+ return 'starting';
+ default:
+ return 'error';
+ }
+ }
+
+ async getDefaultComputer(): Promise<ComputerInfo | null> {
+ const computers = await this.listComputers();
+ // Prefer a running computer, otherwise return the first one
+ return (
+ computers.find((c) => c.status === 'running') ?? computers[0] ?? null
+ );
+ }
+
+ async checkHealth(computerId: string): Promise<boolean> {
+ try {
+ await this.fetch(`/v1/vms/${computerId}/health`);
+ return true;
+ } catch {
+ return false;
+ }
+ }
+}
+
+// =============================================================================
+// Cloud Inference Adapter
+// =============================================================================
+
+class CloudInferenceAdapter implements InferenceAdapter {
+ constructor(
+ private apiKey: string,
+ private baseUrl: string
+ ) {}
+
+ async getConfig(computer: ComputerInfo): Promise<InferenceConfig> {
+ // Cloud manages API keys server-side, so we don't need to pass env vars
+ return {
+ baseUrl: computer.agentUrl,
+ };
+ }
+
+ async getAvailableModels(): Promise<ModelProvider[]> {
+ try {
+ const response = await fetch(`${this.baseUrl}/v1/models`, {
+ headers: { Authorization: `Bearer ${this.apiKey}` },
+ });
+
+ if (!response.ok) {
+ // Return default models if endpoint not available
+ return this.getDefaultModels();
+ }
+
+ return response.json();
+ } catch {
+ // Return default models on error
+ return this.getDefaultModels();
+ }
+ }
+
+ private getDefaultModels(): ModelProvider[] {
+ return [
+ {
+ name: 'Anthropic',
+ models: [
+ { id: 'claude-sonnet-4-20250514', name: 'Claude Sonnet 4' },
+ { id: 'claude-3-5-sonnet-20241022', name: 'Claude 3.5 Sonnet' },
+ ],
+ },
+ ];
+ }
+}
+
+// =============================================================================
+// Factory Function
+// =============================================================================
+
+/**
+ * Create a cloud adapter bundle for the playground.
+ *
+ * @param config - Configuration for the cloud adapter
+ * @returns PlaygroundAdapters bundle for cloud usage
+ *
+ * @example
+ * ```typescript
+ * const adapters = createCloudAdapter({
+ * apiKey: userApiKey,
+ * baseUrl: 'https://api.cua.ai', // optional
+ * });
+ *
+ * <Playground adapters={adapters} />
+ * ```
+ */
+export function createCloudAdapter(
+ config: CloudAdapterConfig
+): PlaygroundAdapters {
+ const baseUrl = config.baseUrl || 'https://api.cua.ai';
+
+ return {
+ persistence: new CloudPersistenceAdapter(config.apiKey, baseUrl),
+ computer: new CloudComputerAdapter(config.apiKey, baseUrl),
+ inference: new CloudInferenceAdapter(config.apiKey, baseUrl),
+ };
+}
diff --git a/libs/typescript/playground/src/adapters/index.ts b/libs/typescript/playground/src/adapters/index.ts
new file mode 100644
index 0000000000..9346252100
--- /dev/null
+++ b/libs/typescript/playground/src/adapters/index.ts
@@ -0,0 +1,4 @@
+// Adapter exports
+export { createLocalAdapter } from './local';
+export { createCloudAdapter } from './cloud';
+export * from './types';
diff --git a/libs/typescript/playground/src/adapters/local.ts b/libs/typescript/playground/src/adapters/local.ts
new file mode 100644
index 0000000000..f4f40f98b1
--- /dev/null
+++ b/libs/typescript/playground/src/adapters/local.ts
@@ -0,0 +1,244 @@
+// Local adapter implementation
+// Uses localStorage for persistence, user-provided computer URLs, and user-provided API keys
+
+import type {
+ PlaygroundAdapters,
+ PersistenceAdapter,
+ ComputerAdapter,
+ InferenceAdapter,
+ LocalAdapterConfig,
+ ComputerInfo,
+ InferenceConfig,
+} from './types';
+import type { AgentMessage, Chat, ModelProvider } from '../types';
+import {
+ loadItemsFromLocalStorage,
+ saveItemsToLocalStorage,
+ loadItemFromLocalStorage,
+ saveItemToLocalStorage,
+} from '../utils/localStorage';
+
+// =============================================================================
+// Storage Keys
+// =============================================================================
+
+const STORAGE_KEYS = {
+ CHATS: 'playground-chats',
+ CUSTOM_COMPUTERS: 'playground-custom-computers',
+ SETTINGS: 'playground-settings',
+} as const;
+
+// =============================================================================
+// Local Persistence Adapter
+// =============================================================================
+
+class LocalPersistenceAdapter implements PersistenceAdapter {
+ async loadChats(): Promise<Chat[]> {
+ return loadItemsFromLocalStorage<Chat>({ storageKey: STORAGE_KEYS.CHATS });
+ }
+
+ async saveChat(chat: Chat): Promise<Chat> {
+ const chats = await this.loadChats();
+ const index = chats.findIndex((c) => c.id === chat.id);
+ if (index >= 0) {
+ chats[index] = chat;
+ } else {
+ chats.push(chat);
+ }
+ saveItemsToLocalStorage(chats, { storageKey: STORAGE_KEYS.CHATS });
+ return chat;
+ }
+
+ async deleteChat(chatId: string): Promise<void> {
+ const chats = await this.loadChats();
+ saveItemsToLocalStorage(
+ chats.filter((c) => c.id !== chatId),
+ { storageKey: STORAGE_KEYS.CHATS }
+ );
+ }
+
+ async saveMessages(chatId: string, messages: AgentMessage[]): Promise<void> {
+ const chats = await this.loadChats();
+ const chat = chats.find((c) => c.id === chatId);
+ if (chat) {
+ chat.messages = messages;
+ await this.saveChat(chat);
+ }
+ }
+
+ async loadSettings<T>(key: string): Promise<T | null> {
+ const settings = loadItemFromLocalStorage<Record<string, unknown>>({
+ storageKey: STORAGE_KEYS.SETTINGS,
+ });
+ if (!settings) return null;
+ return (settings[key] as T) ?? null;
+ }
+
+ async saveSettings<T>(key: string, value: T): Promise<void> {
+ const settings =
+ loadItemFromLocalStorage<Record<string, unknown>>({
+ storageKey: STORAGE_KEYS.SETTINGS,
+ }) || {};
+ settings[key] = value;
+ saveItemToLocalStorage(settings, { storageKey: STORAGE_KEYS.SETTINGS });
+ }
+}
+
+// =============================================================================
+// Local Computer Adapter
+// =============================================================================
+
+class LocalComputerAdapter implements ComputerAdapter {
+ constructor(private config: LocalAdapterConfig) {}
+
+ async listComputers(): Promise<ComputerInfo[]> {
+ const customComputers = loadItemsFromLocalStorage<ComputerInfo>({
+ storageKey: STORAGE_KEYS.CUSTOM_COMPUTERS,
+ });
+
+ // If a default computer URL is configured, add it
+ if (this.config.computerServerUrl) {
+ const defaultComputer: ComputerInfo = {
+ id: 'default',
+ name: 'Local Computer',
+ vncUrl: `${this.config.computerServerUrl}/vnc`,
+ agentUrl: this.config.computerServerUrl,
+ status: 'running',
+ };
+ return [defaultComputer, ...customComputers];
+ }
+
+ return customComputers;
+ }
+
+ async getDefaultComputer(): Promise<ComputerInfo | null> {
+ const computers = await this.listComputers();
+ return computers[0] ?? null;
+ }
+
+ async addCustomComputer(
+ computer: Omit<ComputerInfo, 'id'>
+ ): Promise<ComputerInfo> {
+ const newComputer: ComputerInfo = {
+ ...computer,
+ id: crypto.randomUUID(),
+ isCustom: true,
+ };
+ const computers = loadItemsFromLocalStorage<ComputerInfo>({
+ storageKey: STORAGE_KEYS.CUSTOM_COMPUTERS,
+ });
+ computers.push(newComputer);
+ saveItemsToLocalStorage(computers, {
+ storageKey: STORAGE_KEYS.CUSTOM_COMPUTERS,
+ });
+ return newComputer;
+ }
+
+ async removeCustomComputer(computerId: string): Promise<void> {
+ const computers = loadItemsFromLocalStorage<ComputerInfo>({
+ storageKey: STORAGE_KEYS.CUSTOM_COMPUTERS,
+ });
+ saveItemsToLocalStorage(
+ computers.filter((c) => c.id !== computerId),
+ { storageKey: STORAGE_KEYS.CUSTOM_COMPUTERS }
+ );
+ }
+
+ async checkHealth(computerId: string): Promise<boolean> {
+ const computers = await this.listComputers();
+ const computer = computers.find((c) => c.id === computerId);
+ if (!computer) return false;
+
+ try {
+ const response = await fetch(`${computer.agentUrl}/health`, {
+ method: 'GET',
+ signal: AbortSignal.timeout(5000),
+ });
+ return response.ok;
+ } catch {
+ return false;
+ }
+ }
+}
+
+// =============================================================================
+// Local Inference Adapter
+// =============================================================================
+
+class LocalInferenceAdapter implements InferenceAdapter {
+ constructor(private config: LocalAdapterConfig) {}
+
+ async getConfig(computer: ComputerInfo): Promise<InferenceConfig> {
+ const env: Record<string, string> = {};
+
+ if (this.config.providerApiKeys?.anthropic) {
+ env.ANTHROPIC_API_KEY = this.config.providerApiKeys.anthropic;
+ }
+ if (this.config.providerApiKeys?.openai) {
+ env.OPENAI_API_KEY = this.config.providerApiKeys.openai;
+ }
+
+ return {
+ baseUrl: computer.agentUrl,
+ env,
+ };
+ }
+
+ async getAvailableModels(): Promise<ModelProvider[]> {
+ const providers: ModelProvider[] = [];
+
+ if (this.config.providerApiKeys?.anthropic) {
+ providers.push({
+ name: 'Anthropic',
+ models: [
+ { id: 'claude-sonnet-4-20250514', name: 'Claude Sonnet 4' },
+ { id: 'claude-3-5-sonnet-20241022', name: 'Claude 3.5 Sonnet' },
+ ],
+ });
+ }
+
+ if (this.config.providerApiKeys?.openai) {
+ providers.push({
+ name: 'OpenAI',
+ models: [
+ { id: 'gpt-4o', name: 'GPT-4o' },
+ { id: 'gpt-4o-mini', name: 'GPT-4o Mini' },
+ ],
+ });
+ }
+
+ return providers;
+ }
+}
+
+// =============================================================================
+// Factory Function
+// =============================================================================
+
+/**
+ * Create a local adapter bundle for the playground.
+ *
+ * @param config - Configuration for the local adapter
+ * @returns PlaygroundAdapters bundle for local usage
+ *
+ * @example
+ * ```typescript
+ * const adapters = createLocalAdapter({
+ * computerServerUrl: 'http://localhost:8443',
+ * providerApiKeys: {
+ * anthropic: process.env.ANTHROPIC_API_KEY,
+ * },
+ * });
+ *
+ * <Playground adapters={adapters} />
+ * ```
+ */
+export function createLocalAdapter(
+ config: LocalAdapterConfig = {}
+): PlaygroundAdapters {
+ return {
+ persistence: new LocalPersistenceAdapter(),
+ computer: new LocalComputerAdapter(config),
+ inference: new LocalInferenceAdapter(config),
+ };
+}
diff --git a/libs/typescript/playground/src/adapters/types.ts b/libs/typescript/playground/src/adapters/types.ts
new file mode 100644
index 0000000000..787123d549
--- /dev/null
+++ b/libs/typescript/playground/src/adapters/types.ts
@@ -0,0 +1,155 @@
+// Adapter interfaces (contracts) for the playground
+// These define WHAT the playground needs, not HOW it's implemented
+
+import type { AgentMessage, Chat, ModelProvider } from '../types';
+
+// =============================================================================
+// Main Adapter Bundle
+// =============================================================================
+
+/**
+ * Main adapter bundle that the Playground component receives.
+ * Provides all the infrastructure the playground needs to function.
+ */
+export interface PlaygroundAdapters {
+ persistence: PersistenceAdapter;
+ computer: ComputerAdapter;
+ inference: InferenceAdapter;
+}
+
+// =============================================================================
+// Persistence Adapter
+// =============================================================================
+
+/**
+ * Contract: Where chats are stored
+ * - Local implementation: localStorage
+ * - Cloud implementation: CUA API
+ */
+export interface PersistenceAdapter {
+ /** Load all chats for the current user/session */
+ loadChats(): Promise<Chat[]>;
+
+ /** Load a single chat by ID (with messages) */
+ loadChat?(chatId: string): Promise<Chat | null>;
+
+ /** Save a chat (create or update) */
+ saveChat(chat: Chat): Promise<Chat>;
+
+ /** Delete a chat by ID */
+ deleteChat(chatId: string): Promise<void>;
+
+ /** Save messages for a specific chat */
+ saveMessages(chatId: string, messages: AgentMessage[]): Promise<void>;
+
+ /** Load a settings value by key */
+ loadSettings<T>(key: string): Promise<T | null>;
+
+ /** Save a settings value by key */
+ saveSettings<T>(key: string, value: T): Promise<void>;
+}
+
+// =============================================================================
+// Computer Adapter
+// =============================================================================
+
+/**
+ * Computer info as exposed by the adapter.
+ * Normalized representation that works for both VMs and custom computers.
+ */
+export interface ComputerInfo {
+ id: string;
+ name: string;
+ vncUrl: string;
+ agentUrl: string;
+ status: 'running' | 'stopped' | 'starting' | 'error';
+ isCustom?: boolean;
+}
+
+/**
+ * Contract: What computers are available
+ * - Local implementation: user-provided URLs, stored in localStorage
+ * - Cloud implementation: CUA API for VMs
+ */
+export interface ComputerAdapter {
+ /** List all available computers */
+ listComputers(): Promise<ComputerInfo[]>;
+
+ /** Get the default computer (first running one, or null) */
+ getDefaultComputer(): Promise<ComputerInfo | null>;
+
+ /** Add a custom computer (optional, for local adapter) */
+ addCustomComputer?(computer: Omit<ComputerInfo, 'id'>): Promise<ComputerInfo>;
+
+ /** Remove a custom computer (optional, for local adapter) */
+ removeCustomComputer?(computerId: string): Promise<void>;
+
+ /** Check if a computer is healthy/reachable (optional) */
+ checkHealth?(computerId: string): Promise<boolean>;
+}
+
+// =============================================================================
+// Inference Adapter
+// =============================================================================
+
+/**
+ * Configuration for making inference requests.
+ * Returned by the inference adapter based on the selected computer.
+ */
+export interface InferenceConfig {
+ /** Base URL for the agent API */
+ baseUrl: string;
+
+ /** Model to use (optional, may be selected by user) */
+ model?: string;
+
+ /** API key for authenticating with the agent server */
+ apiKey?: string;
+
+ /** Environment variables to pass to the agent */
+ env?: Record<string, string>;
+}
+
+/**
+ * Contract: How inference is configured
+ * - Local implementation: user-provided API keys
+ * - Cloud implementation: CUA-managed keys
+ */
+export interface InferenceAdapter {
+ /** Get inference configuration for a specific computer */
+ getConfig(computer: ComputerInfo): Promise<InferenceConfig>;
+
+ /** Get available model providers and their models */
+ getAvailableModels(): Promise<ModelProvider[]>;
+}
+
+// =============================================================================
+// Factory Function Config Types
+// =============================================================================
+
+/**
+ * Configuration for creating a local adapter.
+ * Used when running the playground locally with user-provided resources.
+ */
+export interface LocalAdapterConfig {
+ /** URL of the computer server (e.g., http://localhost:8443) */
+ computerServerUrl?: string;
+
+ /** API keys for different providers */
+ providerApiKeys?: {
+ anthropic?: string;
+ openai?: string;
+ };
+}
+
+/**
+ * Configuration for creating a cloud adapter.
+ * Used when running the playground with CUA cloud infrastructure.
+ */
+export interface CloudAdapterConfig {
+ /** CUA API key for authentication */
+ apiKey: string;
+
+ /** Base URL for the CUA API (defaults to https://api.cua.ai) */
+ baseUrl?: string;
+}
diff --git a/libs/typescript/playground/src/components/Playground.tsx b/libs/typescript/playground/src/components/Playground.tsx
new file mode 100644
index 0000000000..8e598597dd
--- /dev/null
+++ b/libs/typescript/playground/src/components/Playground.tsx
@@ -0,0 +1,253 @@
+// Main Playground component
+// Composition of all playground pieces with slots for customization
+
+import { useState, type ReactNode, useMemo } from 'react';
+import { PlaygroundProvider } from '../context/PlaygroundProvider';
+import { ChatProvider } from '../context/ChatProvider';
+import { usePlayground, useIsChatGenerating, useFindDefaultModel } from '../hooks/usePlayground';
+import { ChatPanel } from './composed/ChatPanel';
+import { ChatList } from './composed/ChatList';
+import { ComputerList } from './composed/ComputerList';
+import { EmptyStateWithInput } from './composed/EmptyState';
+import { VNCViewer } from './primitives/VNCViewer';
+import { CustomComputerModal } from './modals/CustomComputerModal';
+import type { PlaygroundAdapters } from '../adapters/types';
+import type { Chat } from '../types';
+import { cn } from '../utils/cn';
+
+// =============================================================================
+// Props
+// =============================================================================
+
+interface PlaygroundProps {
+ /** Adapters for persistence, computer, and inference */
+ adapters: PlaygroundAdapters;
+ /** Optional custom sidebar component (replaces default ChatList) */
+ sidebar?: ReactNode;
+ /** Optional header component */
+ header?: ReactNode;
+ /** Optional footer component */
+ footer?: ReactNode;
+ /** Optional initial chats (for SSR or pre-loading) */
+ initialChats?: Chat[];
+ /** Whether to show the VNC viewer panel */
+ showVNCViewer?: boolean;
+ /** Whether to show the computer list in the sidebar */
+ showComputerList?: boolean;
+ /** Optional class name for the root container */
+ className?: string;
+ /** Logo config for branding */
+ logo?: {
+ lightSrc: string;
+ darkSrc: string;
+ alt: string;
+ };
+ /** Custom welcome message for empty state */
+ welcomeMessage?: string;
+}
+
+// =============================================================================
+// Internal Content Component (uses context)
+// =============================================================================
+
+function PlaygroundContentInternal({
+ sidebar,
+ header,
+ footer,
+ showVNCViewer = true,
+ showComputerList = false,
+ className,
+ logo,
+ welcomeMessage,
+}: Omit<PlaygroundProps, 'adapters' | 'initialChats'>) {
+ const { state, dispatch, adapters } = usePlayground();
+ const [showCustomComputerModal, setShowCustomComputerModal] = useState(false);
+ const defaultModel = useFindDefaultModel();
+
+ const activeChat = state.activeChatId
+ ? state.chats.find((c) => c.id === state.activeChatId)
+ : null;
+
+ const isGenerating = useIsChatGenerating(activeChat?.id ?? null);
+
+ // Get VNC URL for current computer
+ const currentComputer = state.computers.find((c) => c.id === state.currentComputerId);
+ const vncUrl = currentComputer?.vncUrl;
+
+ // Create a draft chat for the empty state UI
+ const draftChat = useMemo<Chat>(
+ () => ({
+ id: 'draft',
+ name: 'New Chat',
+ messages: [],
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ }),
+ [defaultModel]
+ );
+
+ // Handle creating a new chat and sending the first message
+ const handleCreateAndSend = async (message: string) => {
+ const newChat: Chat = {
+ id: crypto.randomUUID(),
+ name: message.slice(0, 50) || 'New Chat',
+ messages: [],
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ };
+
+ try {
+ // Save to adapter first to get the server-assigned ID
+ const savedChat = await adapters.persistence.saveChat(newChat);
+
+ dispatch({ type: 'ADD_CHAT', payload: savedChat });
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: savedChat.id });
+
+ // The message will be sent by ChatPanel once it's active
+ // Store the initial message to be sent
+ // Note: This is handled by the ChatPanel/ChatProvider
+ } catch (error) {
+ console.error('Failed to create chat:', error);
+ }
+ };
+
+ // Create a new chat without a message
+ const handleCreateChat = async () => {
+ const newChat: Chat = {
+ id: crypto.randomUUID(),
+ name: 'New Chat',
+ messages: [],
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ };
+
+ try {
+ const savedChat = await adapters.persistence.saveChat(newChat);
+ dispatch({ type: 'ADD_CHAT', payload: savedChat });
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: savedChat.id });
+ } catch (error) {
+ console.error('Failed to create chat:', error);
+ }
+ };
+
+ // Show loading state
+ if (state.isLoading) {
+ return (
+ <div className={cn('flex h-screen items-center justify-center', className)}>
+ <div className="text-center">
+ <div className="mb-4 h-8 w-8 animate-spin rounded-full border-4 border-neutral-300 border-t-neutral-900"></div>
+ <p className="text-neutral-500">Loading...</p>
+ </div>
+ </div>
+ );
+ }
+
+ // Show error state
+ if (state.error) {
+ return (
+ <div className={cn('flex h-screen items-center justify-center', className)}>
+ <div className="text-center">
+ <p className="text-red-600">{state.error}</p>
+ </div>
+ </div>
+ );
+ }
+
+ return (
+ <div className={cn('flex h-screen', className)}>
+ {/* Sidebar slot - for custom sidebar or default */}
+ {sidebar ?? (
+ <aside className="flex w-64 flex-col border-r bg-white dark:bg-neutral-900">
+ <ChatList onCreateChat={handleCreateChat} />
+ {showComputerList && (
+ <>
+ <div className="border-t" />
+ <ComputerList
+ className="flex-1"
+ onAddComputer={() => setShowCustomComputerModal(true)}
+ />
+ </>
+ )}
+ </aside>
+ )}
+
+ {/* Main content */}
+ <main className="flex flex-1 flex-col">
+ {header}
+
+ <div className="flex flex-1 overflow-hidden">
+ {/* Chat panel */}
+ <div className={cn('flex-1', showVNCViewer && 'max-w-[50%]')}>
+ {activeChat ? (
+ <ChatProvider chat={activeChat} isGenerating={isGenerating}>
+ <ChatPanel />
+ </ChatProvider>
+ ) : (
+ <EmptyStateWithInput
+ onCreateAndSend={handleCreateAndSend}
+ isMobile={false}
+ draftChat={draftChat}
+ logo={logo}
+ welcomeMessage={welcomeMessage}
+ />
+ )}
+ </div>
+
+ {/* VNC viewer */}
+ {showVNCViewer && (
+ <div className="w-1/2 border-l">
+ {vncUrl ? (
+ <VNCViewer src={vncUrl} />
+ ) : (
+ <div className="flex h-full items-center justify-center text-neutral-500">
+ No computer selected
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+
+ {footer}
+ </main>
+
+ {/* Custom Computer Modal */}
+ <CustomComputerModal
+ isOpen={showCustomComputerModal}
+ onClose={() => setShowCustomComputerModal(false)}
+ />
+ </div>
+ );
+}
+
+// =============================================================================
+// Main Playground Component
+// =============================================================================
+
+/**
+ * Main Playground component.
+ * Provides a full-featured chat interface with VNC viewer.
+ *
+ * @example
+ * ```tsx
+ * import { Playground, createLocalAdapter } from '@trycua/playground';
+ *
+ * const adapters = createLocalAdapter({
+ * computerServerUrl: 'http://localhost:8443',
+ * providerApiKeys: { anthropic: 'sk-...' },
+ * });
+ *
+ * function App() {
+ * return <Playground adapters={adapters} />;
+ * }
+ * ```
+ */
+export function Playground({ adapters, initialChats, ...props }: PlaygroundProps) {
+ return (
+ <PlaygroundProvider adapters={adapters} initialChats={initialChats}>
+ <PlaygroundContentInternal {...props} />
+ </PlaygroundProvider>
+ );
+}
diff --git a/libs/typescript/playground/src/components/TrajectoryViewer/index.tsx b/libs/typescript/playground/src/components/TrajectoryViewer/index.tsx
new file mode 100644
index 0000000000..3723cb92dd
--- /dev/null
+++ b/libs/typescript/playground/src/components/TrajectoryViewer/index.tsx
@@ -0,0 +1,1852 @@
+import {
+ Bot,
+ Camera,
+ Keyboard,
+ MousePointer,
+ MousePointerClick,
+ Pause,
+ Play,
+ Terminal,
+} from 'lucide-react';
+import type React from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
+
+// Hook to detect system dark mode preference
+function useDarkMode(): boolean {
+ const [isDarkMode, setIsDarkMode] = useState(() => {
+ if (typeof window === 'undefined') return false;
+ return window.matchMedia('(prefers-color-scheme: dark)').matches;
+ });
+
+ useEffect(() => {
+ if (typeof window === 'undefined') return;
+
+ const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
+ const handler = (e: MediaQueryListEvent) => setIsDarkMode(e.matches);
+
+ mediaQuery.addEventListener('change', handler);
+ return () => mediaQuery.removeEventListener('change', handler);
+ }, []);
+
+ return isDarkMode;
+}
+
+interface FileEntry {
+ name: string;
+ path: string;
+ type: string; // 'screenshot' | 'json' | 'other'
+ parentFolder: string;
+}
+
+interface Action {
+ type: string;
+ text: string;
+ keys: string[];
+ start_x: number;
+ start_y: number;
+ end_x: number;
+ end_y: number;
+ x: number;
+ y: number;
+}
+
+interface TurnFolder {
+ name: string;
+ files: FileEntry[];
+ screenshot?: string; // URL to the first screenshot
+ frameIndex?: number; // Frame index in video for lazy loading
+ agentResponse?: {
+ text: string[];
+ actions: Action[];
+ cursorPositions: [number, number][];
+ thought: string | null;
+ model?: string; // Model name that generated the response
+ };
+}
+
+interface TrajectoryViewerProps {
+ files?: File[];
+ zipUrl?: string;
+ mp4Url?: string;
+ jsonUrl?: string;
+ showToolbar?: boolean;
+ scroll?: boolean;
+ scenarioName?: string;
+ operatingSystem?: 'linux' | 'macos' | 'windows';
+ autoLoop?: boolean;
+ userPrompt?: string;
+ isActive?: boolean;
+ playbackDelay?: number;
+ modelOverride?: string;
+}
+
+const TrajectoryViewer: React.FC<TrajectoryViewerProps> = ({
+ files,
+ zipUrl,
+ mp4Url,
+ jsonUrl,
+ showToolbar = true,
+ scroll = true,
+ scenarioName = 'Demo',
+ operatingSystem = 'linux',
+ autoLoop = false,
+ userPrompt,
+ isActive = true,
+ playbackDelay = 0,
+ modelOverride,
+}) => {
+ const isDarkMode = useDarkMode();
+ const [folders, setFolders] = useState<TurnFolder[]>([]);
+ const [selectedFolder, setSelectedFolder] = useState<string | null>(null);
+
+ const [isPlaying, setIsPlaying] = useState<boolean>(false);
+ const [hasStartedPlaying, setHasStartedPlaying] = useState<boolean>(false);
+ const folderRefs = useRef<{ [key: string]: HTMLButtonElement | null }>({});
+ // Original dimensions for the screenshots
+ const [originalDimensions, setOriginalDimensions] = useState({
+ width: 1920,
+ height: 1080,
+ });
+ // Add state for cursor animation
+ const [cursorPosition, setCursorPosition] = useState<[number, number]>([0, 0]);
+ const [cursorTarget, setCursorTarget] = useState<[number, number]>([0, 0]);
+ const [isAnimating, setIsAnimating] = useState<boolean>(false);
+ const [isClicking, setIsClicking] = useState<boolean>(false);
+ const [cursorScale, setCursorScale] = useState<number>(1);
+ const [isDragging, setIsDragging] = useState<boolean>(false);
+ const [dragStart, setDragStart] = useState<[number, number]>([0, 0]);
+ const [dragEnd, setDragEnd] = useState<[number, number]>([0, 0]);
+ const [dragProgress, setDragProgress] = useState<number>(0);
+ // Initialize isLoading to true if we have URLs to load, false otherwise
+ const [isLoading, setIsLoading] = useState<boolean>(
+ !!(mp4Url && jsonUrl) || !!zipUrl || !!(files && files.length > 0)
+ );
+
+ const animationRef = useRef<number | null>(null);
+ const clickAnimationRef = useRef<number | null>(null);
+ const dragAnimationRef = useRef<number | null>(null);
+
+ // Control bar dragging state - x is percentage from left, bottom is percentage from bottom
+ const [controlBarPosition, setControlBarPosition] = useState<{
+ x: number;
+ bottom: number;
+ }>(() => {
+ // 20% from bottom on mobile, 10% on desktop
+ const isMobileInitial = typeof window !== 'undefined' && window.innerWidth < 1024;
+ return { x: 50, bottom: isMobileInitial ? 20 : 10 };
+ });
+ const [isControlBarDragging, setIsControlBarDragging] = useState<boolean>(false);
+ const [controlBarDragOffset, setControlBarDragOffset] = useState<{
+ x: number;
+ y: number;
+ }>({ x: 0, y: 0 });
+ const controlBarRef = useRef<HTMLDivElement>(null);
+
+ // Ref to track processed MP4/JSON URLs to prevent infinite loops
+ const processedUrlsRef = useRef<string>('');
+
+ // Refs for lazy frame loading from MP4
+ const videoRef = useRef<HTMLVideoElement | null>(null);
+ const videoUrlRef = useRef<string | null>(null);
+ const extractingFrameRef = useRef<boolean>(false);
+
+ // Handle control bar dragging (mouse and touch)
+ useEffect(() => {
+ const updatePosition = (clientX: number, clientY: number) => {
+ if (!controlBarRef.current) return;
+
+ const videoContainer = controlBarRef.current.parentElement?.parentElement;
+ if (!videoContainer) return;
+
+ const rect = videoContainer.getBoundingClientRect();
+ const barRect = controlBarRef.current.getBoundingClientRect();
+
+ // Calculate bar size as percentage
+ const barWidthPercent = (barRect.width / rect.width) * 100;
+ const barHeightPercent = (barRect.height / rect.height) * 100;
+
+ // Calculate new position as percentage
+ // Add half bar size because position represents center (due to transform: translate(-50%, 50%))
+ const newX =
+ ((clientX - rect.left - controlBarDragOffset.x) / rect.width) * 100 + barWidthPercent / 2;
+ // Calculate bottom position (distance from bottom edge)
+ const newBottom =
+ ((rect.bottom - clientY - controlBarDragOffset.y) / rect.height) * 100 +
+ barHeightPercent / 2;
+
+ // Constrain within bounds
+ const constrainedX = Math.max(barWidthPercent / 2, Math.min(100 - barWidthPercent / 2, newX));
+ const constrainedBottom = Math.max(
+ barHeightPercent / 2,
+ Math.min(100 - barHeightPercent / 2, newBottom)
+ );
+
+ setControlBarPosition({ x: constrainedX, bottom: constrainedBottom });
+ };
+
+ const handleMouseMove = (e: MouseEvent) => {
+ if (!isControlBarDragging) return;
+ updatePosition(e.clientX, e.clientY);
+ };
+
+ const handleTouchMove = (e: TouchEvent) => {
+ if (!isControlBarDragging || e.touches.length === 0) return;
+ const touch = e.touches[0];
+ updatePosition(touch.clientX, touch.clientY);
+ e.preventDefault();
+ };
+
+ const handleEnd = () => {
+ setIsControlBarDragging(false);
+ };
+
+ if (isControlBarDragging) {
+ document.addEventListener('mousemove', handleMouseMove);
+ document.addEventListener('mouseup', handleEnd);
+ document.addEventListener('touchmove', handleTouchMove, {
+ passive: false,
+ });
+ document.addEventListener('touchend', handleEnd);
+ document.addEventListener('touchcancel', handleEnd);
+ }
+
+ return () => {
+ document.removeEventListener('mousemove', handleMouseMove);
+ document.removeEventListener('mouseup', handleEnd);
+ document.removeEventListener('touchmove', handleTouchMove);
+ document.removeEventListener('touchend', handleEnd);
+ document.removeEventListener('touchcancel', handleEnd);
+ };
+ }, [isControlBarDragging, controlBarDragOffset]);
+
+ const handleControlBarMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {
+ if (!controlBarRef.current) return;
+
+ const barRect = controlBarRef.current.getBoundingClientRect();
+
+ // Calculate offset - x from left, y from bottom of the bar
+ setControlBarDragOffset({
+ x: e.clientX - barRect.left,
+ y: barRect.bottom - e.clientY,
+ });
+
+ setIsControlBarDragging(true);
+ e.preventDefault();
+ };
+
+ const handleControlBarTouchStart = (e: React.TouchEvent<HTMLDivElement>) => {
+ if (!controlBarRef.current || e.touches.length === 0) return;
+
+ const touch = e.touches[0];
+ const barRect = controlBarRef.current.getBoundingClientRect();
+
+ // Calculate offset - x from left, y from bottom of the bar
+ setControlBarDragOffset({
+ x: touch.clientX - barRect.left,
+ y: barRect.bottom - touch.clientY,
+ });
+
+ setIsControlBarDragging(true);
+ };
+
+ const parseAgentResponse = useCallback(
+ async (
+ file: File
+ ): Promise<{
+ text: string[];
+ actions: Action[];
+ cursorPositions: [number, number][];
+ thought: string | null;
+ model?: string; // Model name that generated the response
+ }> => {
+ const result = {
+ text: [] as string[],
+ actions: [] as Action[],
+ cursorPositions: [] as [number, number][],
+ thought: null as string | null,
+ model: undefined as string | undefined,
+ };
+
+ try {
+ const content = await file.text();
+ const data = JSON.parse(content);
+ const responseData = data.response || {};
+
+ // Extract model information if available
+ if (data.model) {
+ result.model = data.model;
+ }
+
+ // First check for content field (simple text response)
+ if (responseData.content) {
+ result.text.push(responseData.content);
+ }
+
+ // Process outputs array if present
+ const outputs = responseData.output || [];
+ for (const output of outputs) {
+ const outputType = output.type || 'message';
+
+ if (outputType === 'message') {
+ const contentParts = output.content || [];
+ if (Array.isArray(contentParts)) {
+ for (const contentPart of contentParts) {
+ if (contentPart.text) {
+ result.text.push(contentPart.text);
+ }
+ }
+ } else {
+ result.text.push(contentParts);
+ }
+ } else if (outputType === 'reasoning') {
+ // Handle reasoning (thought) content
+ const summaryContent = output.summary || [];
+ if (summaryContent.length > 0) {
+ for (const summaryPart of summaryContent) {
+ if (summaryPart.type === 'summary_text') {
+ result.text.push(summaryPart.text);
+ }
+ }
+ } else {
+ const summaryText = output.text || '';
+ if (summaryText) {
+ result.text.push(summaryText);
+ }
+ }
+ } else if (outputType === 'computer_call') {
+ const action = output.action || {};
+ if (Object.keys(action).length > 0) {
+ result.actions.push(action);
+ // Extract cursor position if available
+ if (
+ action.type === 'drag' &&
+ action.start_x !== undefined &&
+ action.start_y !== undefined &&
+ action.end_x !== undefined &&
+ action.end_y !== undefined
+ ) {
+ // For drag actions, store both start and end positions
+ const startPosition: [number, number] = [action.start_x, action.start_y];
+ const endPosition: [number, number] = [action.end_x, action.end_y];
+ result.cursorPositions.push(startPosition, endPosition);
+ } else if (action.x !== undefined && action.y !== undefined) {
+ const position: [number, number] = [action.x, action.y];
+ result.cursorPositions.push(position);
+ }
+
+ // // Determine action type
+ // const actionType = action.type || '';
+ // if (['click', 'double_click', 'triple_click', 'left_mouse_down'].includes(actionType)) {
+ // result.actionType = 'clicking';
+ // } else if (['type', 'keypress'].includes(actionType)) {
+ // result.actionType = 'typing';
+ // } else if (actionType === 'drag') {
+ // result.actionType = 'dragging';
+ // }
+ }
+ }
+ }
+
+ // Set thought from text if available
+ if (result.text.length > 0) {
+ result.thought = result.text.join(' ');
+ }
+
+ // Set cursor position if not found
+ // if (result.cursorPositions.length === 0 && lastKnownCursorPosition) {
+ // result.cursorPositions = [lastKnownCursorPosition];
+ // }
+ } catch (error) {
+ console.error('[Trajectory Viewer] Error parsing agent response:', error);
+ }
+
+ return result;
+ },
+ []
+ );
+
+ const getCursorPosition = useCallback(
+ (selectedFolder: string | null): [number, number] | null => {
+ if (!selectedFolder || folders.length === 0) return [50, 50]; // Default to middle
+
+ // Find the index of the current folder
+ const currentIndex = folders.findIndex((folder) => folder.name === selectedFolder);
+ if (currentIndex === -1) return [50, 50]; // Default if folder not found
+
+ // Check current folder first
+ const currentFolder = folders[currentIndex];
+ if ((currentFolder.agentResponse?.cursorPositions?.length ?? 0) > 0) {
+ return currentFolder.agentResponse!.cursorPositions[0];
+ }
+
+ // Search backwards through previous folders
+ for (let i = currentIndex - 1; i >= 0; i--) {
+ const prevFolder = folders[i];
+ if ((prevFolder.agentResponse?.cursorPositions?.length ?? 0) > 0) {
+ // Get the last position from the array
+ return prevFolder.agentResponse!.cursorPositions[
+ prevFolder.agentResponse!.cursorPositions.length - 1
+ ];
+ }
+ }
+
+ // No position found, default to middle
+ return [originalDimensions.width / 2, originalDimensions.height / 2];
+ },
+ [folders, originalDimensions.width, originalDimensions.height]
+ );
+
+ const processFiles = useCallback(
+ (files: File[]) => {
+ if (!files || files.length === 0) return;
+
+ setIsLoading(true);
+ const turnFolders: { [key: string]: TurnFolder } = {};
+
+ // First identify the trajectory folder structure
+ let trajectoryFolderName = '';
+
+ // Find the first turn_001 folder to identify the trajectory folder
+ for (const file of files) {
+ const path = file.webkitRelativePath || file.name;
+ const pathParts = path.split('/');
+
+ // Looking for paths like: trajectory_folder/turn_001/...
+ if (pathParts.length >= 2 && pathParts[1].startsWith('turn_')) {
+ trajectoryFolderName = pathParts[0];
+ break;
+ }
+ }
+
+ if (!trajectoryFolderName) {
+ console.error('Could not find a valid trajectory folder with turn_XXX subfolders');
+ setIsLoading(false);
+ return;
+ }
+
+ const updateFolders = () => {
+ // Sort folders by name (assuming they follow turn_001, turn_002 pattern)
+ // using regex to extract the number
+ const sortedFolders = Object.values(turnFolders).sort(
+ (a, b) =>
+ Number.parseInt(a.name.match(/\d+/)![0]) - Number.parseInt(b.name.match(/\d+/)![0])
+ );
+ setFolders(sortedFolders);
+ if (sortedFolders.length > 0) {
+ setSelectedFolder(sortedFolders[0].name);
+ // Initialize cursor position with the first folder's cursor position
+ const initialPosition = getCursorPosition(sortedFolders[0].name);
+ if (initialPosition) {
+ setCursorPosition(initialPosition);
+ setCursorTarget(initialPosition);
+ }
+ }
+
+ // Set loading to false once processing is complete
+ setIsLoading(false);
+ };
+
+ // Now process all files within the turn folders
+ for (const file of files) {
+ const path = file.webkitRelativePath || file.name;
+ const pathParts = path.split('/');
+
+ // We're looking for files inside turn folders (depth 2 or more)
+ if (
+ pathParts.length < 3 ||
+ pathParts[0] !== trajectoryFolderName ||
+ !pathParts[1].startsWith('turn_')
+ ) {
+ continue; // Skip files not in a proper turn folder
+ }
+
+ const turnFolder = pathParts[1]; // This is the turn_XXX folder name
+ const fileName = pathParts[pathParts.length - 1];
+
+ // Initialize folder if it doesn't exist
+ if (!turnFolders[turnFolder]) {
+ turnFolders[turnFolder] = {
+ name: turnFolder,
+ files: [],
+ };
+ }
+
+ // Determine file type
+ let fileType = 'other';
+ if (
+ (fileName.startsWith('screenshot_') && fileName.endsWith('.png')) ||
+ fileName.endsWith('screenshot.png') ||
+ fileName.endsWith('screenshot_action.png') ||
+ fileName.endsWith('screenshot_after.png') ||
+ fileName.endsWith('screenshot_before.png')
+ ) {
+ fileType = 'screenshot';
+
+ // Create URL for the first screenshot found
+ if (!turnFolders[turnFolder].screenshot) {
+ turnFolders[turnFolder].screenshot = URL.createObjectURL(file);
+ }
+ } else if (fileName.endsWith('_agent_response.json')) {
+ fileType = 'json';
+
+ // Parse the JSON file
+ parseAgentResponse(file).then((parsedData) => {
+ turnFolders[turnFolder].agentResponse = parsedData;
+ updateFolders();
+ });
+ }
+
+ // Add file to the folder
+ turnFolders[turnFolder].files.push({
+ name: fileName,
+ path,
+ type: fileType,
+ parentFolder: turnFolder,
+ });
+ }
+
+ updateFolders();
+ setIsLoading(false);
+ },
+ [parseAgentResponse, getCursorPosition]
+ );
+
+ // Function to animate the click action
+ const animateClick = useCallback((onComplete: () => void) => {
+ setIsClicking(true);
+
+ // Start time for animation
+ const startTime = performance.now();
+ const clickDuration = 300; // 300ms for the entire click animation
+ const minScale = 0.5; // Minimum scale during click
+
+ const animateClickStep = (timestamp: number) => {
+ const elapsed = timestamp - startTime;
+ const progress = Math.min(elapsed / clickDuration, 1);
+
+ // Scale down quickly, then back up with spring effect
+ let newScale: number;
+
+ if (progress < 0.3) {
+ // Scale down phase (first 30% of animation)
+ newScale = 1 - (1 - minScale) * (progress / 0.3);
+ } else {
+ // Scale up phase with spring effect
+ // Use a sine wave for spring effect
+ const springProgress = (progress - 0.3) / minScale; // Normalized 0-1 for the spring phase
+ const springEffect =
+ Math.sin(springProgress * Math.PI * 2) * 0.1 * (1 - springProgress) ** 2;
+ newScale = minScale + (1 - minScale) * springProgress + springEffect;
+ }
+
+ setCursorScale(newScale);
+
+ if (progress < 1) {
+ clickAnimationRef.current = requestAnimationFrame(animateClickStep);
+ } else {
+ // Animation complete
+ setCursorScale(1);
+ setIsClicking(false);
+ onComplete();
+ }
+
+ // When cursor reaches minimum scale (around progress = 0.3), reveal the next frame
+ if (progress >= 0.3 && progress <= 0.32) {
+ onComplete();
+ }
+ };
+
+ clickAnimationRef.current = requestAnimationFrame(animateClickStep);
+
+ return () => {
+ if (clickAnimationRef.current) {
+ cancelAnimationFrame(clickAnimationRef.current);
+ }
+ };
+ }, []);
+
+ const animateDrag = useCallback(
+ (start: [number, number], end: [number, number], onComplete: () => void) => {
+ // Start time for animation
+ const startTime = performance.now();
+ const dragDuration = 500; // 500ms for the entire drag animation
+
+ const animateDragStep = (timestamp: number) => {
+ const elapsed = timestamp - startTime;
+ const progress = Math.min(elapsed / dragDuration, 1);
+
+ // Update drag progress for line rendering
+ setDragProgress(progress);
+
+ // Calculate new cursor position along the drag path
+ const newX = start[0] + (end[0] - start[0]) * progress;
+ const newY = start[1] + (end[1] - start[1]) * progress;
+
+ // Update cursor position
+ setCursorPosition([newX, newY]);
+
+ if (progress < 1) {
+ dragAnimationRef.current = requestAnimationFrame(animateDragStep);
+ } else {
+ // Animation complete
+ setDragProgress(1); // Ensure it's at 100%
+ onComplete();
+ }
+ };
+
+ dragAnimationRef.current = requestAnimationFrame(animateDragStep);
+
+ return () => {
+ if (dragAnimationRef.current) {
+ cancelAnimationFrame(dragAnimationRef.current);
+ }
+ };
+ },
+ []
+ );
+
+ // Ref for the sidebar scroll container
+ const sidebarRef = useRef<HTMLDivElement>(null);
+
+ // Helper function to scroll a folder button into view within the sidebar only
+ // This prevents affecting the main page scroll
+ const scrollFolderIntoView = useCallback((folderName: string) => {
+ const folderButton = folderRefs.current[folderName];
+ const sidebar = sidebarRef.current;
+
+ if (!folderButton || !sidebar) return;
+
+ const buttonRect = folderButton.getBoundingClientRect();
+ const sidebarRect = sidebar.getBoundingClientRect();
+
+ // Check if button is outside the visible area of the sidebar
+ if (buttonRect.top < sidebarRect.top) {
+ // Button is above visible area - scroll up
+ sidebar.scrollTop += buttonRect.top - sidebarRect.top - 10;
+ } else if (buttonRect.bottom > sidebarRect.bottom) {
+ // Button is below visible area - scroll down
+ sidebar.scrollTop += buttonRect.bottom - sidebarRect.bottom + 10;
+ }
+ }, []);
+
+ const goToNextFolder = useCallback(() => {
+ if (!selectedFolder || folders.length === 0) return;
+
+ // Find the index of the current folder
+ const currentIndex = folders.findIndex((folder) => folder.name === selectedFolder);
+ if (currentIndex === -1) return;
+
+ // If at the last folder and autoLoop is enabled, go back to the first folder
+ if (currentIndex >= folders.length - 1) {
+ if (autoLoop) {
+ setSelectedFolder(folders[0].name);
+ }
+ return;
+ }
+
+ // Get the next folder
+ const nextFolder = folders[currentIndex + 1].name;
+
+ // Check if we have cursor positions to animate to
+ const nextFolderData = folders[currentIndex + 1];
+ const hasClickAction = nextFolderData.agentResponse?.actions?.some(
+ (action) => action.type === 'click' || action.type === 'double_click'
+ );
+ const hasDragAction = nextFolderData.agentResponse?.actions?.some(
+ (action) => action.type === 'drag'
+ );
+
+ if ((nextFolderData.agentResponse?.cursorPositions?.length ?? 0) > 0) {
+ // Set animation target
+ const target = nextFolderData.agentResponse!.cursorPositions[0];
+ setCursorTarget(target);
+ setIsAnimating(true);
+
+ // Check if this is a drag action
+ if (hasDragAction) {
+ // Find the drag action
+ const dragAction = nextFolderData.agentResponse?.actions?.find(
+ (action) => action.type === 'drag'
+ );
+ if (dragAction) {
+ // Set up drag animation
+ const dragStartPos: [number, number] = [dragAction.start_x, dragAction.start_y];
+ const dragEndPos: [number, number] = [dragAction.end_x, dragAction.end_y];
+ // After cursor reaches start position, begin drag animation
+ setTimeout(() => {
+ // Start drag animation
+ setDragStart(dragStartPos);
+ setDragEnd(dragEndPos);
+ setIsDragging(true);
+ setDragProgress(0);
+
+ // Force cursor position to start position
+ setCursorPosition(dragStartPos);
+ setIsAnimating(false);
+
+ animateDrag(dragStartPos, dragEndPos, () => {
+ // After drag animation completes
+ setIsDragging(false);
+ setIsAnimating(false);
+ setSelectedFolder(nextFolder);
+
+ // Scroll the next folder into view within the sidebar only
+ if (scroll) {
+ scrollFolderIntoView(nextFolder);
+ }
+ });
+ }, 500); // Give time for cursor to move to start position
+ }
+ }
+ // If this is a click action, start with cursor movement, then do click animation
+ else if (hasClickAction) {
+ // First animate cursor to position
+ // After cursor movement completes, do click animation
+ setTimeout(() => {
+ animateClick(() => {
+ // After click animation completes, reveal next frame
+ setSelectedFolder(nextFolder);
+ setIsAnimating(false);
+
+ // Scroll the next folder into view within the sidebar only
+ if (scroll) {
+ scrollFolderIntoView(nextFolder);
+ }
+ });
+ }, 500); // Give time for cursor to move to position
+ } else {
+ // After animation completes (transition is 500ms), update selected folder
+ setTimeout(() => {
+ setSelectedFolder(nextFolder);
+ setIsAnimating(false);
+
+ // Scroll the next folder into view within the sidebar only
+ if (scroll) {
+ scrollFolderIntoView(nextFolder);
+ }
+ }, 500);
+ }
+ } else {
+ // If we don't have positions, just change folders immediately
+ setSelectedFolder(nextFolder);
+
+ // Scroll the next folder into view within the sidebar only
+ if (scroll) {
+ scrollFolderIntoView(nextFolder);
+ }
+ }
+ }, [folders, selectedFolder, scroll, animateClick, animateDrag, scrollFolderIntoView, autoLoop]);
+
+ const togglePlayback = () => {
+ setIsPlaying(!isPlaying);
+ };
+
+ // Auto-advance when playing
+ useEffect(() => {
+ let intervalId: ReturnType<typeof setInterval> | null = null;
+
+ if (isPlaying && !isAnimating) {
+ intervalId = setInterval(() => {
+ goToNextFolder();
+ }, 1000); // Increased delay to allow for animation
+ }
+
+ return () => {
+ if (intervalId) clearInterval(intervalId);
+ };
+ }, [isPlaying, goToNextFolder, isAnimating]);
+
+ // Handle playback based on isActive state and playbackDelay
+ useEffect(() => {
+ let timeoutId: ReturnType<typeof setTimeout> | null = null;
+
+ if (isActive && folders.length > 0) {
+ // Start playback after delay when becoming active
+ if (!hasStartedPlaying) {
+ timeoutId = setTimeout(() => {
+ setIsPlaying(true);
+ setHasStartedPlaying(true);
+ }, playbackDelay);
+ } else {
+ // Resume playback immediately if already started before
+ setIsPlaying(true);
+ }
+ } else if (!isActive) {
+ // Pause when becoming inactive
+ setIsPlaying(false);
+ }
+
+ return () => {
+ if (timeoutId) clearTimeout(timeoutId);
+ };
+ }, [isActive, folders.length, playbackDelay, hasStartedPlaying]);
+
+ const selectedFolderData = folders.find((folder) => folder.name === selectedFolder);
+
+ // Get the first valid model name from any folder
+ const getFirstValidModel = () => {
+ for (const folder of folders) {
+ if (folder.agentResponse?.model) {
+ return folder.agentResponse.model;
+ }
+ }
+ return null;
+ };
+
+ // Get the model once when folders are loaded
+ const modelName = modelOverride || getFirstValidModel();
+
+ // Update original dimensions when the image loads
+ useEffect(() => {
+ if (selectedFolderData?.screenshot) {
+ const img = new Image();
+ img.onload = () => {
+ setOriginalDimensions({
+ width: img.naturalWidth,
+ height: img.naturalHeight,
+ });
+ };
+ img.src = selectedFolderData.screenshot;
+ }
+ }, [selectedFolderData?.screenshot]);
+
+ // Effect to animate cursor movement
+ useEffect(() => {
+ // Only animate if not at target already
+ if (
+ isAnimating &&
+ (cursorPosition[0] !== cursorTarget[0] || cursorPosition[1] !== cursorTarget[1])
+ ) {
+ // Calculate step sizes for smooth animation
+ const startTime = performance.now();
+ const duration = 100; // 100ms animation for movement
+
+ const animateStep = (timestamp: number) => {
+ const elapsed = timestamp - startTime;
+ const progress = Math.min(elapsed / duration, 1);
+
+ // Use easing function for smoother animation (ease-out-cubic)
+ const easeProgress = 1 - (1 - progress) ** 3;
+
+ // Calculate new position
+ const newX = cursorPosition[0] + (cursorTarget[0] - cursorPosition[0]) * easeProgress;
+ const newY = cursorPosition[1] + (cursorTarget[1] - cursorPosition[1]) * easeProgress;
+
+ setCursorPosition([newX, newY]);
+
+ // Continue animation if not complete
+ if (progress < 1) {
+ animationRef.current = requestAnimationFrame(animateStep);
+ }
+ };
+
+ animationRef.current = requestAnimationFrame(animateStep);
+
+ // Cleanup function
+ return () => {
+ if (animationRef.current !== null) {
+ cancelAnimationFrame(animationRef.current);
+ }
+ };
+ }
+ }, [isAnimating, cursorPosition, cursorTarget]);
+
+ // Get cursor position for the selected folder, checking previous folders if needed
+ // Get previous screenshot for the selected folder if current folder has none
+ const getPreviousScreenshot = (selectedFolder: string | null): string | null => {
+ if (!selectedFolder || folders.length === 0) return null;
+
+ // Find the index of the current folder
+ const currentIndex = folders.findIndex((folder) => folder.name === selectedFolder);
+ if (currentIndex === -1) return null;
+
+ // Search backwards through previous folders
+ for (let i = currentIndex - 1; i >= 0; i--) {
+ const prevFolder = folders[i];
+ if (prevFolder.screenshot) {
+ return prevFolder.screenshot;
+ }
+ }
+
+ // No previous screenshot found
+ return null;
+ };
+
+ // Function to animate drag action
+ // Generate skeleton turns for loading state
+ const generateSkeletonTurns = (count: number) => {
+ const skeletons = [];
+ for (let i = folders.length + 1; i <= count; i++) {
+ skeletons.push(
+ <div key={`skeleton-${i}`} className="flex animate-pulse flex-col gap-1 py-2 opacity-50">
+ {/* Turn number skeleton */}
+ <div className="px-2">
+ <div className="h-4 w-16 rounded bg-neutral-300 dark:bg-neutral-600" />
+ </div>
+
+ {/* Thought skeleton */}
+ <div className="px-2">
+ <div className="mb-1 h-4 w-full rounded bg-neutral-300 dark:bg-neutral-600" />
+ <div className="h-4 w-3/4 rounded bg-neutral-300 dark:bg-neutral-600" />
+ </div>
+
+ {/* Action skeleton */}
+ <div className="rounded border border-neutral-200 px-2 py-1 dark:border-neutral-700">
+ <div className="flex items-center gap-2">
+ <div className="h-5 w-5 rounded bg-neutral-300 dark:bg-neutral-600" />
+ <div className="h-4 w-32 rounded bg-neutral-300 dark:bg-neutral-600" />
+ </div>
+ </div>
+ </div>
+ );
+ }
+ return skeletons;
+ };
+
+ // Clean up animations and video on unmount
+ useEffect(() => {
+ return () => {
+ if (animationRef.current !== null) {
+ cancelAnimationFrame(animationRef.current);
+ }
+ if (clickAnimationRef.current !== null) {
+ cancelAnimationFrame(clickAnimationRef.current);
+ }
+ if (dragAnimationRef.current !== null) {
+ cancelAnimationFrame(dragAnimationRef.current);
+ }
+ // Clean up video element and object URL
+ if (videoUrlRef.current) {
+ URL.revokeObjectURL(videoUrlRef.current);
+ }
+ videoRef.current = null;
+ videoUrlRef.current = null;
+ };
+ }, []);
+
+ // Function to fetch and process zip file from URL
+ const processZipUrl = useCallback(
+ async (url: string) => {
+ try {
+ setIsLoading(true);
+
+ // Import zip.js dynamically to avoid issues with SSR
+ const { BlobReader, ZipReader, TextWriter, BlobWriter } = await import('@zip.js/zip.js');
+
+ // Fetch the zip file
+ const response = await fetch(url);
+ if (!response.ok) {
+ throw new Error(`Failed to fetch zip: ${response.status} ${response.statusText}`);
+ }
+
+ const zipBlob = await response.blob();
+
+ // Create a zip reader
+ const zipReader = new ZipReader(new BlobReader(zipBlob));
+
+ // Get all entries from the zip file
+ const entries = await zipReader.getEntries();
+
+ if (entries.length === 0) {
+ setIsLoading(false);
+ throw new Error('Zip file is empty');
+ }
+
+ // Convert zip entries to File objects for processing
+ const extractedFiles: File[] = [];
+
+ // Find the base directory name (trajectory folder)
+ let trajectoryFolderName = '';
+
+ // Look for the first turn_001 folder to identify the trajectory folder
+ for (const entry of entries) {
+ const pathParts = entry.filename.split('/');
+ if (pathParts.length >= 2 && pathParts[1].startsWith('turn_')) {
+ trajectoryFolderName = pathParts[0];
+ break;
+ }
+ }
+
+ if (!trajectoryFolderName) {
+ console.error(
+ '[Trajectory Viewer] Could not find a valid trajectory folder with turn_XXX subfolders'
+ );
+ return;
+ }
+
+ // Process each entry
+ for (const entry of entries) {
+ if (!entry.directory) {
+ try {
+ // For text files (like JSON)
+ let fileData: Blob;
+ if (entry.filename.endsWith('.json')) {
+ const text = (await entry?.getData?.(new TextWriter())) || '';
+ fileData = new Blob([text], { type: 'application/json' });
+ } else {
+ // For binary files (like images)
+ const blobData = await entry?.getData?.(new BlobWriter());
+ fileData = blobData || new Blob([]);
+ }
+
+ // Create a File object with the correct path information
+ const file = new File([fileData], entry.filename.split('/').pop() || '', {
+ type: entry.filename.endsWith('.json')
+ ? 'application/json'
+ : entry.filename.endsWith('.png')
+ ? 'image/png'
+ : entry.filename.endsWith('.jpg')
+ ? 'image/jpeg'
+ : 'application/octet-stream',
+ });
+
+ // Add webkitRelativePath to mimic file input with webkitdirectory
+ Object.defineProperty(file, 'webkitRelativePath', {
+ value: entry.filename,
+ writable: false,
+ });
+
+ extractedFiles.push(file);
+ } catch (err) {
+ console.error(`[Trajectory Viewer] Error extracting ${entry.filename}:`, err);
+ }
+ }
+ }
+
+ // Close the zip reader
+ await zipReader.close();
+
+ // Process the extracted files
+ if (extractedFiles.length > 0) {
+ processFiles(extractedFiles);
+ }
+ } catch (error) {
+ console.error('[Trajectory Viewer] Error processing zip URL:', error);
+ setIsLoading(false);
+ }
+ },
+ [processFiles]
+ );
+
+ // Extract a single frame from the video at the given frame index
+ const extractFrame = useCallback(async (frameIndex: number): Promise<string | null> => {
+ const video = videoRef.current;
+ if (!video || extractingFrameRef.current) return null;
+
+ extractingFrameRef.current = true;
+
+ try {
+ // Seek to the frame time
+ video.currentTime = frameIndex;
+
+ await new Promise<void>((resolve) => {
+ video.onseeked = () => resolve();
+ });
+
+ // Draw frame to canvas
+ const canvas = document.createElement('canvas');
+ canvas.width = video.videoWidth;
+ canvas.height = video.videoHeight;
+ const ctx = canvas.getContext('2d');
+
+ if (ctx) {
+ ctx.drawImage(video, 0, 0);
+
+ // Convert to blob and create URL
+ const frameBlob = await new Promise<Blob>((resolve) => {
+ canvas.toBlob((blob) => {
+ resolve(blob!);
+ }, 'image/png');
+ });
+
+ return URL.createObjectURL(frameBlob);
+ }
+ } catch (error) {
+ console.error('[Trajectory Viewer] Error extracting frame:', error);
+ } finally {
+ extractingFrameRef.current = false;
+ }
+
+ return null;
+ }, []);
+
+ // Lazy load frame for a specific folder
+ const lazyLoadFrame = useCallback(
+ async (folderName: string) => {
+ const folderIndex = folders.findIndex((f) => f.name === folderName);
+ if (folderIndex === -1) return;
+
+ const folder = folders[folderIndex];
+ // Already has screenshot or no frame index
+ if (folder.screenshot || folder.frameIndex === undefined) return;
+
+ const screenshotUrl = await extractFrame(folder.frameIndex);
+ if (screenshotUrl) {
+ setFolders((prevFolders) => {
+ const newFolders = [...prevFolders];
+ const idx = newFolders.findIndex((f) => f.name === folderName);
+ if (idx !== -1 && !newFolders[idx].screenshot) {
+ newFolders[idx] = { ...newFolders[idx], screenshot: screenshotUrl };
+ }
+ return newFolders;
+ });
+ }
+ },
+ [folders, extractFrame]
+ );
+
+ // Preload frames ahead of current selection
+ const preloadAhead = useCallback(
+ async (currentFolderName: string, count: number = 3) => {
+ const currentIndex = folders.findIndex((f) => f.name === currentFolderName);
+ if (currentIndex === -1) return;
+
+ // Preload next N frames
+ for (let i = 1; i <= count && currentIndex + i < folders.length; i++) {
+ const nextFolder = folders[currentIndex + i];
+ if (!nextFolder.screenshot && nextFolder.frameIndex !== undefined) {
+ await lazyLoadFrame(nextFolder.name);
+ }
+ }
+ },
+ [folders, lazyLoadFrame]
+ );
+
+ // Process MP4 and JSON files with lazy frame loading
+ const processMP4Json = useCallback(
+ async (mp4Url: string, jsonUrl: string) => {
+ if (processedUrlsRef.current === `${mp4Url},${jsonUrl}`) {
+ return;
+ }
+
+ processedUrlsRef.current = `${mp4Url},${jsonUrl}`;
+
+ try {
+ setIsLoading(true);
+
+ // Fetch both files in parallel
+ const [mp4Response, jsonResponse] = await Promise.all([fetch(mp4Url), fetch(jsonUrl)]);
+
+ if (!mp4Response.ok || !jsonResponse.ok) {
+ throw new Error('Failed to fetch MP4 or JSON file');
+ }
+
+ const [mp4Blob, jsonText] = await Promise.all([mp4Response.blob(), jsonResponse.text()]);
+
+ // Parse JSON file
+ const jsonData = JSON.parse(jsonText);
+ const { screenshots, agent_responses } = jsonData;
+
+ const turnFolders: { [key: string]: TurnFolder } = {};
+
+ // Create turn folders from screenshots with frame indices for lazy loading
+ if (screenshots) {
+ for (const screenshot of screenshots) {
+ const { turn_name, frame_index } = screenshot;
+ if (!turnFolders[turn_name]) {
+ turnFolders[turn_name] = {
+ name: turn_name,
+ files: [],
+ frameIndex: frame_index, // Store frame index for lazy loading
+ };
+ }
+ }
+ }
+
+ // Process agent responses
+ if (agent_responses) {
+ for (const response of agent_responses) {
+ const { turn_name, content } = response;
+
+ if (!turnFolders[turn_name]) {
+ turnFolders[turn_name] = {
+ name: turn_name,
+ files: [],
+ };
+ }
+
+ // Create a File object from the content to reuse parseAgentResponse
+ const agentResponseFile = new File([content], `${turn_name}_agent_response.json`, {
+ type: 'application/json',
+ });
+
+ try {
+ const parsedData = await parseAgentResponse(agentResponseFile);
+ turnFolders[turn_name].agentResponse = parsedData;
+ } catch (error) {
+ console.error(
+ `[Trajectory Viewer] Error parsing agent response for ${turn_name}:`,
+ error
+ );
+ }
+
+ turnFolders[turn_name].files.push({
+ name: `${turn_name}_agent_response.json`,
+ path: `trajectory/${turn_name}/${turn_name}_agent_response.json`,
+ type: 'json',
+ parentFolder: turn_name,
+ });
+ }
+ }
+
+ // Create video element and store in ref for lazy frame extraction
+ const video = document.createElement('video');
+ const videoObjectUrl = URL.createObjectURL(mp4Blob);
+ video.src = videoObjectUrl;
+ video.muted = true;
+ video.preload = 'metadata';
+
+ await new Promise((resolve, reject) => {
+ video.onloadedmetadata = resolve;
+ video.onerror = reject;
+ });
+
+ // Store video ref for lazy loading
+ videoRef.current = video;
+ videoUrlRef.current = videoObjectUrl;
+
+ // Set original dimensions from video
+ setOriginalDimensions({
+ width: video.videoWidth,
+ height: video.videoHeight,
+ });
+
+ // Extract only the first frame immediately
+ if (screenshots && screenshots.length > 0) {
+ const firstScreenshot = screenshots[0];
+ const firstTurnName = firstScreenshot.turn_name;
+
+ video.currentTime = firstScreenshot.frame_index || 0;
+ await new Promise((resolve) => {
+ video.onseeked = () => resolve(undefined);
+ });
+
+ const canvas = document.createElement('canvas');
+ canvas.width = video.videoWidth;
+ canvas.height = video.videoHeight;
+ const ctx = canvas.getContext('2d');
+
+ if (ctx) {
+ ctx.drawImage(video, 0, 0);
+ const frameBlob = await new Promise<Blob>((resolve) => {
+ canvas.toBlob((blob) => resolve(blob!), 'image/png');
+ });
+
+ turnFolders[firstTurnName].screenshot = URL.createObjectURL(frameBlob);
+ }
+ }
+
+ // Sort and set folders (filter out any entries with invalid names)
+ const sortedFolders = Object.values(turnFolders)
+ .filter((folder) => folder.name && typeof folder.name === 'string')
+ .sort((a, b) => {
+ const aMatch = a.name.match(/\d+/);
+ const bMatch = b.name.match(/\d+/);
+ if (!aMatch || !bMatch) return 0;
+ return Number.parseInt(aMatch[0]) - Number.parseInt(bMatch[0]);
+ });
+
+ setFolders(sortedFolders);
+ setSelectedFolder(sortedFolders[0]?.name || null);
+ setIsLoading(false);
+
+ // Initialize cursor position
+ if (sortedFolders.length > 0) {
+ const initialPosition = getCursorPosition(sortedFolders[0].name);
+ if (initialPosition) {
+ setCursorPosition(initialPosition);
+ setCursorTarget(initialPosition);
+ }
+ }
+ } catch (error) {
+ console.error('[Trajectory Viewer] Error processing MP4 and JSON files:', error);
+ setIsLoading(false);
+ }
+ },
+ [parseAgentResponse, getCursorPosition]
+ );
+
+ // Process MP4 and JSON files when URLs are provided
+ useEffect(() => {
+ if (mp4Url && jsonUrl) {
+ processMP4Json(mp4Url, jsonUrl);
+ }
+ }, [mp4Url, jsonUrl, processMP4Json]);
+
+ // Lazy load frame when selected folder changes
+ useEffect(() => {
+ if (selectedFolder && videoRef.current) {
+ // Load the current frame if not already loaded
+ lazyLoadFrame(selectedFolder);
+ // Preload next few frames
+ preloadAhead(selectedFolder, 3);
+ }
+ }, [selectedFolder, lazyLoadFrame, preloadAhead]);
+
+ // Process files when they're provided as props
+ // biome-ignore lint/correctness/useExhaustiveDependencies: don't re-render
+ useEffect(() => {
+ if (files && files.length > 0) {
+ processFiles(files);
+ }
+ }, [files]);
+
+ // Ref to track processed ZIP URL to prevent infinite loops
+ const processedZipUrlRef = useRef<string>('');
+
+ // Process zip URL when provided
+ useEffect(() => {
+ if (zipUrl && processedZipUrlRef.current !== zipUrl) {
+ processedZipUrlRef.current = zipUrl;
+ processZipUrl(zipUrl);
+ }
+ }, [zipUrl, processZipUrl]);
+
+ return (
+ <div className={'flex aspect-auto h-full flex-col overflow-hidden'}>
+ {/* Skeleton loading state - matches exact layout of loaded content */}
+ {isLoading && folders.length === 0 && (
+ <div className="flex h-full flex-col">
+ {/* Skeleton toolbar placeholder to match actual toolbar height */}
+ {showToolbar && (
+ <div className="flex items-center gap-2 border-neutral-200 border-b px-2 py-1.5 md:px-3 md:py-2 dark:border-neutral-800">
+ <div className="flex h-[22px] items-center gap-1.5 rounded-t-lg border border-neutral-300 border-b-0 px-2 py-1 md:h-[26px] md:gap-2 md:px-3 md:py-1.5 dark:border-neutral-700">
+ <div className="h-3 w-3 animate-pulse rounded bg-neutral-300 md:h-3.5 md:w-3.5 dark:bg-neutral-600" />
+ <div className="h-3 w-12 animate-pulse rounded bg-neutral-300 md:h-4 dark:bg-neutral-600" />
+ </div>
+ </div>
+ )}
+ <div
+ className={`${showToolbar ? 'h-[calc(100%-48px)]' : 'h-full'} relative flex flex-col gap-0 lg:flex-row lg:gap-3 lg:p-3`}
+ >
+ {/* Sidebar skeleton - order-2 on mobile/tablet so it appears below video */}
+ <div className="-mt-px order-2 flex h-80 w-full flex-col lg:order-1 lg:mt-0 lg:h-full lg:w-1/4">
+ <div className="flex h-full flex-col gap-3 overflow-hidden p-0 lg:rounded-lg lg:p-3">
+ {/* Skeleton turn items */}
+ {[1, 2, 3, 4].map((i) => (
+ <div key={i} className="flex animate-pulse flex-col gap-2">
+ <div className="flex items-start gap-2">
+ <div className="mt-1 hidden h-6 w-6 flex-shrink-0 rounded-full bg-neutral-300 lg:block dark:bg-neutral-700" />
+ <div className="flex flex-1 flex-col gap-2">
+ <div className="h-3 w-12 rounded bg-neutral-300 dark:bg-neutral-700" />
+ <div className="h-4 w-full rounded bg-neutral-300 dark:bg-neutral-700" />
+ <div className="h-4 w-3/4 rounded bg-neutral-300 dark:bg-neutral-700" />
+ <div className="flex items-center gap-2 rounded-lg px-2 py-1.5">
+ <div className="h-4 w-4 rounded bg-neutral-300 dark:bg-neutral-700" />
+ <div className="h-3 w-24 rounded bg-neutral-300 dark:bg-neutral-700" />
+ </div>
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+
+ {/* Main content skeleton - order-1 on mobile/tablet so it appears above messages */}
+ <div className="order-1 flex h-full w-full flex-col lg:order-2 lg:w-3/4">
+ <div className="relative w-full overflow-hidden lg:h-full lg:flex-grow lg:rounded-lg">
+ {/* Aspect ratio container to match video dimensions */}
+ <div className="aspect-video w-full animate-pulse bg-neutral-200 lg:rounded-lg dark:bg-neutral-800">
+ <div className="flex h-full w-full items-center justify-center">
+ {/* Play button circle */}
+ <div className="flex h-16 w-16 items-center justify-center rounded-full bg-neutral-300/50 dark:bg-neutral-700/50">
+ <div className="ml-1 h-0 w-0 border-y-8 border-y-transparent border-l-12 border-l-neutral-400 dark:border-l-neutral-600" />
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Trajectory viewer */}
+ {!isLoading && folders.length > 0 && (
+ <div className="flex h-full min-h-0 flex-col">
+ {/* Browser-like tab bar */}
+ {showToolbar && (
+ <div className="flex items-center gap-2 border-neutral-200 border-b px-2 py-1.5 md:px-3 md:py-2 dark:border-neutral-800">
+ {/* Tab for current scenario */}
+ <div className="flex items-center gap-1.5 rounded-t-lg border border-neutral-300 border-b-0 px-2 py-1 md:gap-2 md:px-3 md:py-1.5 dark:border-neutral-700">
+ <Bot
+ size={12}
+ className="text-neutral-600 md:h-3.5 md:w-3.5 dark:text-neutral-400"
+ />
+ <span className="font-medium text-neutral-900 text-xs md:text-sm dark:text-white">
+ {scenarioName}
+ </span>
+ </div>
+ </div>
+ )}
+
+ {/* Agent content */}
+ <div
+ id="trajectory-container"
+ className={`${showToolbar ? 'h-[calc(100%-48px)]' : 'h-full'} relative flex min-h-0 flex-col gap-0 overflow-hidden lg:flex-row lg:gap-3 lg:p-3`}
+ >
+ {/* Chat sidebar - order-2 on mobile/tablet so it appears below video */}
+ <div className="-mt-px order-2 flex w-full flex-col overflow-hidden lg:order-1 lg:mt-0 lg:w-1/4">
+ <div ref={sidebarRef} className="flex-1 overflow-y-auto p-0 lg:p-3">
+ {/* User prompt display */}
+ {userPrompt && (
+ <div className="mb-4 flex items-start gap-2 rounded-lg bg-blue-50 p-3 dark:bg-blue-900/20">
+ <div className="mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full bg-blue-500 text-white">
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+ fill="currentColor"
+ className="h-3.5 w-3.5"
+ >
+ <path
+ fillRule="evenodd"
+ d="M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z"
+ clipRule="evenodd"
+ />
+ </svg>
+ </div>
+ <div className="flex flex-col gap-1">
+ <span className="font-medium text-blue-700 text-xs dark:text-blue-300">
+ User
+ </span>
+ <p className="text-neutral-800 text-sm dark:text-neutral-200">{userPrompt}</p>
+ </div>
+ </div>
+ )}
+ {folders.map((folder) => {
+ // Check if this turn only has a screenshot (no thought or actions)
+ const hasTextContent =
+ folder.agentResponse?.thought ||
+ (folder.agentResponse?.actions && folder.agentResponse.actions.length > 0);
+ const isScreenshotOnly = !hasTextContent && folder.screenshot;
+
+ return (
+ <button
+ className={`flex flex-col gap-2 ${isPlaying && folder.name !== selectedFolder ? 'opacity-30' : 'opacity-100'}`}
+ key={folder.name}
+ ref={(el) => {
+ folderRefs.current[folder.name] = el;
+ }}
+ onClick={() => setSelectedFolder(folder.name)}
+ type="button"
+ >
+ {/* Chat message bubble */}
+ <div className="flex flex-col gap-2">
+ {/* Agent message */}
+ <div className="flex items-start gap-2">
+ {/* Agent avatar - hidden on mobile */}
+ <div className="mt-1 hidden h-6 w-6 flex-shrink-0 items-center justify-center rounded-full text-neutral-900 lg:flex dark:text-white">
+ <Bot size={14} />
+ </div>
+
+ {/* Message content */}
+ <div className="flex min-w-0 flex-1 flex-col gap-2">
+ {/* Turn number label */}
+ <div className="text-neutral-500 text-xs dark:text-neutral-400">
+ Turn {folder.name.split('_')[1]}
+ </div>
+
+ {/* Thought bubble */}
+ {folder.agentResponse?.thought && (
+ <div className="rounded-lg rounded-tl-sm px-3 py-2 text-neutral-800 text-sm dark:text-neutral-200">
+ {folder.agentResponse.thought}
+ </div>
+ )}
+
+ {/* Action cards */}
+ {folder.agentResponse?.actions &&
+ folder.agentResponse.actions.length > 0 && (
+ <div className="flex flex-col gap-1">
+ {folder.agentResponse.actions.map((action, index) => (
+ <div
+ key={index}
+ className="flex items-center gap-2 rounded-lg px-2 py-1.5 text-neutral-600 text-xs dark:text-neutral-400"
+ >
+ {action.type === 'click' || action.type === 'double_click' ? (
+ <>
+ <MousePointerClick size={14} className="flex-shrink-0" />
+ <span className="overflow-hidden text-ellipsis">
+ {action.type === 'double_click'
+ ? 'Double Click'
+ : 'Click'}{' '}
+ ({action.x}, {action.y})
+ </span>
+ </>
+ ) : action.type === 'drag' ? (
+ <>
+ <MousePointer size={14} className="flex-shrink-0" />
+ <span className="overflow-hidden text-ellipsis">
+ Drag to ({action.end_x}, {action.end_y})
+ </span>
+ </>
+ ) : action.type === 'type' ? (
+ <>
+ <Keyboard size={14} className="flex-shrink-0" />
+ <span className="overflow-hidden text-ellipsis">
+ Type "{action.text}"
+ </span>
+ </>
+ ) : action.type === 'hotkey' ? (
+ <>
+ <Keyboard size={14} className="flex-shrink-0" />
+ <span className="overflow-hidden text-ellipsis">
+ Press {action.keys.join(' + ')}
+ </span>
+ </>
+ ) : (
+ <>
+ <Terminal size={14} className="flex-shrink-0" />
+ <span className="overflow-hidden text-ellipsis">
+ {action.type}
+ </span>
+ </>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+
+ {/* Screenshot indicator - shows on mobile for screenshot-only turns */}
+ {isScreenshotOnly && (
+ <div className="flex items-center gap-2 rounded-lg px-2 py-1.5 text-neutral-600 text-xs lg:hidden dark:text-neutral-400">
+ <Camera size={14} className="flex-shrink-0" />
+ <span className="overflow-hidden text-ellipsis">Screenshot</span>
+ </div>
+ )}
+
+ {/* Screenshot thumbnail - hidden on mobile */}
+ {folder.screenshot && (
+ <div className="hidden max-w-full overflow-hidden rounded-lg border border-neutral-200 lg:block dark:border-neutral-700">
+ <img
+ src={folder.screenshot}
+ alt="Screenshot"
+ className="w-full max-w-full object-cover"
+ />
+ </div>
+ )}
+
+ {/* Empty state */}
+ {!folder.agentResponse?.thought &&
+ !folder.agentResponse?.actions?.length &&
+ !folder.screenshot && (
+ <div className="rounded-lg rounded-tl-sm px-3 py-2 text-neutral-500 text-sm italic dark:text-neutral-400">
+ No response
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ </button>
+ );
+ })}
+ {isLoading && generateSkeletonTurns(10)}
+ </div>
+ </div>
+
+ {/* Screen area - order-1 on mobile/tablet so it appears above messages */}
+ <div className="order-1 flex h-full w-full flex-col lg:order-2 lg:w-3/4">
+ {/* Video view (top row) */}
+ <div className="relative w-full overflow-hidden lg:flex-grow lg:rounded-lg">
+ {selectedFolderData?.screenshot ? (
+ <div className="relative flex h-full w-full justify-center overflow-hidden">
+ <img
+ src={selectedFolderData.screenshot}
+ alt={`Screenshot from ${selectedFolderData.name}`}
+ className="h-full w-auto"
+ />
+ {/* Drag line overlay */}
+ {isDragging && (
+ <svg className="pointer-events-none absolute top-0 left-0 z-[5] h-full w-full">
+ <line
+ x1={`${(dragStart[0] / originalDimensions.width) * 100}%`}
+ y1={`${(dragStart[1] / originalDimensions.height) * 100}%`}
+ x2={`${
+ (((dragEnd[0] - dragStart[0]) * dragProgress + dragStart[0]) /
+ originalDimensions.width) *
+ 100
+ }%`}
+ y2={`${
+ (((dragEnd[1] - dragStart[1]) * dragProgress + dragStart[1]) /
+ originalDimensions.height) *
+ 100
+ }%`}
+ stroke="rgba(255, 255, 255, 0.8)"
+ strokeWidth="2"
+ strokeDasharray="5,3"
+ style={{
+ filter: 'drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.7))',
+ }}
+ />
+ </svg>
+ )}
+
+ {/* Animated Cursor overlay */}
+ <div
+ className="pointer-events-none absolute"
+ style={{
+ left: `${((cursorPosition[0] || originalDimensions.width / 2) / originalDimensions.width) * 100}%`,
+ top: `${((cursorPosition[1] || originalDimensions.height / 2) / originalDimensions.height) * 100}%`,
+ transform: `translate(-25%, -5%) scale(${cursorScale})`,
+ zIndex: 10,
+ }}
+ >
+ <img
+ src="/content/cursors/handpointing.svg"
+ alt="Cursor"
+ width="32"
+ height="32"
+ style={{
+ filter: 'drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5))',
+ }}
+ />
+ {/* Click animation circle */}
+ {isClicking && (
+ <div
+ className="pointer-events-none absolute border-2 border-blue-500"
+ style={{
+ width: '40px',
+ height: '40px',
+ borderRadius: '50%',
+ animation: 'pulseCircle 1s ease-out',
+ zIndex: 5,
+ }}
+ />
+ )}
+ </div>
+
+ {/* Define keyframe animation for pulse */}
+ <style>{`
+ @keyframes pulseCircle {
+ 0% {
+ transform: translate(-15%, -100%) scale(0.5);
+ opacity: 0.7;
+ }
+ 100% {
+ transform: translate(-15%, -100%) scale(2);
+ opacity: 0;
+ }
+ }
+ `}</style>
+ </div>
+ ) : (
+ // Use previous screenshot if available
+ (() => {
+ const prevScreenshot = getPreviousScreenshot(selectedFolder);
+ if (prevScreenshot) {
+ return (
+ <div className="relative flex h-full w-full justify-center overflow-hidden border border-neutral-200 opacity-70 lg:rounded-lg dark:border-neutral-700">
+ <img
+ src={prevScreenshot}
+ alt={'Previous screenshot'}
+ className="h-full w-auto"
+ />
+ {/* Drag line overlay */}
+ {isDragging && (
+ <svg className="pointer-events-none absolute top-0 left-0 z-[5] h-full w-full">
+ <line
+ x1={`${(dragStart[0] / originalDimensions.width) * 100}%`}
+ y1={`${(dragStart[1] / originalDimensions.height) * 100}%`}
+ x2={`${
+ (((dragEnd[0] - dragStart[0]) * dragProgress + dragStart[0]) /
+ originalDimensions.width) *
+ 100
+ }%`}
+ y2={`${
+ (((dragEnd[1] - dragStart[1]) * dragProgress + dragStart[1]) /
+ originalDimensions.height) *
+ 100
+ }%`}
+ stroke="rgba(255, 255, 255, 0.8)"
+ strokeWidth="2"
+ strokeDasharray="5,3"
+ style={{
+ filter: 'drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.7))',
+ }}
+ />
+ </svg>
+ )}
+
+ {/* Animated Cursor overlay */}
+ <div
+ className="pointer-events-none absolute"
+ style={{
+ left: `${((cursorPosition[0] || originalDimensions.width / 2) / originalDimensions.width) * 100}%`,
+ top: `${((cursorPosition[1] || originalDimensions.height / 2) / originalDimensions.height) * 100}%`,
+ transform: `translate(-50%, -25%) scale(${cursorScale})`,
+ zIndex: 10,
+ transition: isAnimating
+ ? 'none'
+ : 'left 0.05s ease-out, top 0.05s ease-out',
+ }}
+ >
+ <img
+ src="/content/cursors/handpointing.svg"
+ alt="Cursor"
+ width="32"
+ height="32"
+ style={{
+ transformOrigin: '50% 25%',
+ filter: 'drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5))',
+ }}
+ />
+ </div>
+ </div>
+ );
+ }
+ return (
+ <div className="flex h-full w-full items-center justify-center rounded bg-neutral-100 p-8 text-center text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300">
+ <div className="flex flex-col items-center">
+ <div className="h-4 w-16 rounded bg-neutral-300 dark:bg-neutral-600" />
+ <div className="mt-2 h-4 w-32 rounded bg-neutral-300 dark:bg-neutral-600" />
+ </div>
+ </div>
+ );
+ })()
+ )}
+
+ {/* Frosted overlay controls - draggable on all screen sizes */}
+ <div className="pointer-events-none absolute inset-0 z-20">
+ <div
+ ref={controlBarRef}
+ role="toolbar"
+ className="pointer-events-auto absolute cursor-move"
+ style={{
+ left: `${controlBarPosition.x}%`,
+ bottom: `${controlBarPosition.bottom}%`,
+ transform: 'translate(-50%, 50%)',
+ }}
+ onMouseDown={handleControlBarMouseDown}
+ onTouchStart={handleControlBarTouchStart}
+ >
+ {/* Outer frosted frame */}
+ <div className="rounded-2xl bg-neutral-200/50 p-[3px] shadow-sm dark:bg-white/10">
+ {/* Inner content */}
+ <div className="flex items-center gap-4 rounded-xl border border-neutral-200/50 bg-white/80 px-4 py-3 backdrop-blur-sm dark:border-neutral-700/50 dark:bg-neutral-900/80">
+ {/* Play/Pause icon */}
+ <button
+ onClick={togglePlayback}
+ type="button"
+ className="text-neutral-900 transition-colors hover:text-neutral-600 dark:text-white dark:hover:text-neutral-400"
+ title={isPlaying ? 'Pause' : 'Play'}
+ >
+ {isPlaying ? (
+ <Pause size={20} strokeWidth={2.5} />
+ ) : (
+ <Play size={20} strokeWidth={2.5} />
+ )}
+ </button>
+
+ {/* Model info */}
+ {modelName && (
+ <>
+ {/* Model icon and name */}
+ <div className="flex items-center gap-2">
+ {modelName.includes('ByteDance') || modelName.includes('UI-TARS') ? (
+ <>
+ <img
+ src="/img/logos/bytedance.svg"
+ alt="ByteDance"
+ className="h-5 w-5 flex-shrink-0"
+ />
+ <span className="hidden whitespace-nowrap font-medium text-neutral-900 text-sm sm:inline dark:text-white">
+ {modelName}
+ </span>
+ </>
+ ) : modelName.includes('computer-use-preview') ? (
+ <>
+ <img
+ src={
+ isDarkMode
+ ? '/img/logos/openai-white.svg'
+ : '/img/logos/openai-black.svg'
+ }
+ alt="OpenAI"
+ className="h-5 w-5 flex-shrink-0"
+ />
+ <span className="hidden whitespace-nowrap font-medium text-neutral-900 text-sm sm:inline dark:text-white">
+ {modelName}
+ </span>
+ </>
+ ) : modelName.includes('claude-opus') ||
+ modelName.includes('claude-opus-4.5') ||
+ modelName.includes('anthropic/claude-opus') ||
+ modelName.includes('cua/anthropic/claude-opus') ? (
+ <>
+ <img
+ src="/img/logos/claude.svg"
+ alt="Anthropic"
+ className="h-5 w-5 flex-shrink-0"
+ />
+ <span className="hidden whitespace-nowrap font-medium text-neutral-900 text-sm sm:inline dark:text-white">
+ {modelName.includes('claude-opus-4.5')
+ ? 'Claude Opus 4.5'
+ : modelName.includes('claude-opus')
+ ? 'Claude Opus'
+ : modelName}
+ </span>
+ </>
+ ) : modelName.includes('gemini') || modelName.includes('Gemini') ? (
+ <>
+ <img
+ src="/img/providers/google.svg"
+ alt="Google"
+ className="h-5 w-5 flex-shrink-0"
+ />
+ <span className="hidden whitespace-nowrap font-medium text-neutral-900 text-sm sm:inline dark:text-white">
+ {modelName}
+ </span>
+ </>
+ ) : null}
+ </div>
+
+ {/* Separator */}
+ <div className="h-6 w-px bg-neutral-300 dark:bg-neutral-600" />
+
+ {/* Platform icon */}
+ <div className="flex items-center gap-1.5">
+ <img
+ src={
+ operatingSystem === 'macos'
+ ? isDarkMode
+ ? '/img/providers/macos-white.svg'
+ : '/img/providers/macos-black.svg'
+ : operatingSystem === 'windows'
+ ? isDarkMode
+ ? '/img/providers/windows-white.svg'
+ : '/img/providers/windows-black.svg'
+ : isDarkMode
+ ? '/img/providers/linux-white.svg'
+ : '/img/providers/linux-black.svg'
+ }
+ alt={
+ operatingSystem === 'macos'
+ ? 'macOS'
+ : operatingSystem === 'windows'
+ ? 'Windows'
+ : 'Linux'
+ }
+ className="h-5 w-5 flex-shrink-0"
+ />
+ <span className="hidden whitespace-nowrap font-medium text-neutral-900 text-xs sm:inline dark:text-white">
+ {operatingSystem === 'macos'
+ ? 'macOS'
+ : operatingSystem === 'windows'
+ ? 'Windows'
+ : 'Linux'}
+ </span>
+ </div>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default TrajectoryViewer;
diff --git a/libs/typescript/playground/src/components/composed/ChatArea.tsx b/libs/typescript/playground/src/components/composed/ChatArea.tsx
new file mode 100644
index 0000000000..97a65a89a7
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ChatArea.tsx
@@ -0,0 +1,159 @@
+// ChatArea component
+// Adapted from cloud/src/website/app/components/playground/ChatArea.tsx
+
+import { motion } from 'motion/react';
+import { useEffect, useRef } from 'react';
+import { ChatMessage } from '../primitives/ChatMessage';
+import { CountdownTimer } from '../primitives/CountdownTimer';
+import { ThinkingIndicator } from '../primitives/ThinkingIndicator';
+import {
+ useChat,
+ useChatDispatch,
+ useIsChatGenerating,
+ useLastRequestDuration,
+ useRequestStartTime,
+} from '../../hooks/usePlayground';
+
+/** Request timeout in seconds */
+const REQUEST_TIMEOUT_SECONDS = 60;
+
+interface ChatAreaProps {
+ onRetry: () => void;
+ onStopResponse: () => void;
+ onTimeout: () => void;
+}
+
+export function ChatArea({ onRetry, onTimeout }: ChatAreaProps) {
+ const chatState = useChat();
+ const chatDispatch = useChatDispatch();
+ const chatContainerEnd = useRef<HTMLDivElement | null>(null);
+
+ const { id: chatId, processedMessages, chatError, retryState } = chatState;
+
+ // Use global generating state (persists across chat switches)
+ const isGenerating = useIsChatGenerating(chatId);
+ const lastRequestDuration = useLastRequestDuration(chatId);
+ const requestStartTime = useRequestStartTime(chatId);
+
+ // Scroll to bottom when messages change
+ useEffect(() => {
+ if (processedMessages.length) {
+ setTimeout(() => chatContainerEnd.current?.scrollIntoView({ behavior: 'smooth' }), 100);
+ }
+ }, [processedMessages]);
+
+ const handleRetry = () => {
+ chatDispatch({ type: 'SET_ERROR', payload: null });
+ onRetry();
+ };
+
+ return (
+ <>
+ {/* Messages area */}
+ <div className="flex-1 overflow-y-auto p-4 pb-0 md:p-6">
+ <div className="mx-auto max-w-3xl space-y-6">
+ {processedMessages.length > 0 && (
+ <motion.div
+ key={chatId}
+ initial={{ opacity: 0, y: 20 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.3 }}
+ className="space-y-1"
+ >
+ {processedMessages.map((item, index) => {
+ // Determine if this is the last non-user message in a consecutive group
+ const nextMessage = processedMessages[index + 1]?.message;
+ const isLastInGroup =
+ index === processedMessages.length - 1 ||
+ (nextMessage && 'role' in nextMessage && nextMessage.role === 'user');
+
+ // Determine if this is the last user message in a consecutive group
+ const currentMsg = item.message;
+ const isUserMessage = 'role' in currentMsg && currentMsg.role === 'user';
+ const nextMsg = processedMessages[index + 1]?.message;
+ const isLastConsecutiveUserMessage =
+ isUserMessage &&
+ (index === processedMessages.length - 1 ||
+ !(nextMsg && 'role' in nextMsg && nextMsg.role === 'user'));
+
+ // Show duration on the last assistant message when not generating
+ const isLastMessage = index === processedMessages.length - 1;
+ const isAssistantMessage = 'role' in currentMsg && currentMsg.role === 'assistant';
+ const showDuration =
+ isLastMessage &&
+ isAssistantMessage &&
+ !isGenerating &&
+ lastRequestDuration !== null;
+
+ return (
+ <ChatMessage
+ key={`${item.message.type}-${index}`}
+ message={item.message}
+ screenshot={item.screenshot}
+ toolCalls={item.toolCalls}
+ isLastInGroup={isLastInGroup}
+ isLastConsecutiveUserMessage={isLastConsecutiveUserMessage}
+ durationSeconds={showDuration ? lastRequestDuration : undefined}
+ />
+ );
+ })}
+
+ {/* Error message display */}
+ {chatError && (
+ <motion.div
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ className="space-y-2"
+ >
+ <div>
+ <p className="font-medium text-red-600 text-sm dark:text-red-400">
+ Request Failed
+ </p>
+ <p className="mt-1 text-neutral-700 text-sm dark:text-neutral-300">
+ {chatError.message}
+ </p>
+ </div>
+ <button
+ type="button"
+ onClick={handleRetry}
+ className="rounded-md bg-neutral-200 px-3 py-1.5 text-neutral-700 text-sm transition-colors hover:bg-neutral-300 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"
+ >
+ Try Again
+ </button>
+ </motion.div>
+ )}
+
+ {/* Retry indicator */}
+ {retryState && (
+ <motion.div
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ className="rounded-md bg-amber-50 px-3 py-2 dark:bg-amber-950/30"
+ >
+ <p className="text-amber-700 text-sm dark:text-amber-400">
+ Connection failed. Retrying... (attempt {retryState.attempt + 1}/
+ {retryState.maxRetries})
+ </p>
+ </motion.div>
+ )}
+
+ {/* Thinking indicator with bouncing dots and scrambled text */}
+ {isGenerating && (
+ <div className="space-y-2">
+ <ThinkingIndicator />
+ <CountdownTimer
+ key={requestStartTime ?? 0}
+ durationSeconds={REQUEST_TIMEOUT_SECONDS}
+ onTimeout={onTimeout}
+ isActive={isGenerating}
+ />
+ </div>
+ )}
+ </motion.div>
+ )}
+ <div ref={chatContainerEnd} />
+ </div>
+ </div>
+ </>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ChatContent.tsx b/libs/typescript/playground/src/components/composed/ChatContent.tsx
new file mode 100644
index 0000000000..f7af760cdd
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ChatContent.tsx
@@ -0,0 +1,296 @@
+// ChatContent component
+// Adapted from cloud/src/website/app/components/playground/ChatContent.tsx
+
+import { motion } from 'motion/react';
+import { useEffect, useMemo, useRef } from 'react';
+import { ChatArea } from './ChatArea';
+import { ChatInput } from '../primitives/ChatInput';
+import { ExamplePrompts, type ExamplePrompt } from './ExamplePrompts';
+import {
+ useChat,
+ useChatDispatch,
+ usePlayground,
+ useIsChatGenerating,
+} from '../../hooks/usePlayground';
+import { useAgentRequest } from '../../hooks/useAgentRequest';
+import type { Computer, VM } from '../../types';
+import { getComputerId } from '../../types';
+import { cn } from '../../utils/cn';
+
+interface ChatContentProps {
+ /** Whether the viewport is mobile */
+ isMobile?: boolean;
+
+ // Optional session/credits props (for cloud usage)
+ hasOrg?: boolean;
+ hasWorkspace?: boolean;
+ hasCredits?: boolean;
+ orgSlug?: string;
+
+ // VM management callbacks
+ onRestartVM?: (vm: VM) => void;
+ onStartVM?: (vm: VM) => void;
+
+ // Auto-send first message (for creating chats with pre-filled messages)
+ shouldAutoSendFirstMessage?: boolean;
+ onAutoSendComplete?: () => void;
+
+ // Custom rendering
+ renderLink?: (props: {
+ to: string;
+ children: React.ReactNode;
+ className?: string;
+ }) => React.ReactNode;
+ renderVMStatusBanner?: (props: {
+ onRestartVM?: (vm: VM) => void;
+ onStartVM?: (vm: VM) => void;
+ hasOrg?: boolean;
+ hasWorkspace?: boolean;
+ hasCredits?: boolean;
+ orgSlug?: string;
+ computer?: Computer;
+ computers: Computer[];
+ }) => React.ReactNode;
+
+ // Logo URLs for empty state
+ lightLogoUrl?: string;
+ darkLogoUrl?: string;
+
+ // Example prompts customization
+ examplePrompts?: ExamplePrompt[];
+ onExamplePromptSelected?: (promptId: string, promptTitle: string) => void;
+
+ // Toast callback for user notifications
+ onToast?: (message: string, type?: 'success' | 'error' | 'info') => void;
+
+ // Custom class name
+ className?: string;
+}
+
+/**
+ * Chat content component that provides the main chat interface.
+ * Must be used inside a ChatProvider.
+ */
+export function ChatContent({
+ isMobile = false,
+ hasOrg = true,
+ hasWorkspace = true,
+ hasCredits = true,
+ orgSlug,
+ onRestartVM,
+ onStartVM,
+ shouldAutoSendFirstMessage,
+ onAutoSendComplete,
+ renderLink,
+ renderVMStatusBanner,
+ lightLogoUrl = '/cua_logo_black_new.svg',
+ darkLogoUrl = '/cua_logo_white_new.svg',
+ examplePrompts,
+ onExamplePromptSelected,
+ onToast,
+ className,
+}: ChatContentProps) {
+ const { handleSendMessage, handleStopResponse, handleTimeout, handleRetry } = useAgentRequest();
+ const { state, dispatch: playgroundDispatch } = usePlayground();
+ const chatState = useChat();
+ const chatDispatch = useChatDispatch();
+ const hasAutoSentRef = useRef(false);
+
+ const { processedMessages, computer, model, currentInput, id: chatId } = chatState;
+ const isGenerating = useIsChatGenerating(chatId);
+
+ const handleSelectPrompt = (prompt: string) => {
+ chatDispatch({ type: 'SET_INPUT', payload: prompt });
+ };
+
+ // Auto-send first message when chat is created from empty state
+ useEffect(() => {
+ if (shouldAutoSendFirstMessage && !hasAutoSentRef.current) {
+ hasAutoSentRef.current = true;
+ // Use handleRetry which sends the existing messages to the agent
+ handleRetry();
+ onAutoSendComplete?.();
+ }
+ }, [shouldAutoSendFirstMessage, handleRetry, onAutoSendComplete]);
+
+ const hasMessages = processedMessages.length > 0;
+
+ // Convert ComputerInfo[] to Computer[] for ChatInput
+ const computers: Computer[] = state.computers.map((c) => {
+ const { agentUrl, ...rest } = c;
+ return {
+ ...rest,
+ url: agentUrl,
+ } as Computer;
+ });
+
+ // Determine selected computer: prefer currentComputerId from playground state, fallback to chat's computer
+ // This ensures the Select stays in sync with the VNC viewer
+ const selectedComputerForInput = useMemo(() => {
+ if (state.currentComputerId) {
+ const currentComputer = computers.find((c) => getComputerId(c) === state.currentComputerId);
+ if (currentComputer) {
+ return currentComputer;
+ }
+ }
+ return computer;
+ }, [state.currentComputerId, computers, computer]);
+
+ // Handle model change
+ const handleModelChange = (modelId: string) => {
+ for (const provider of state.availableModels) {
+ const foundModel = provider.models.find((m) => m.id === modelId);
+ if (foundModel) {
+ chatDispatch({ type: 'SET_MODEL', payload: foundModel });
+ return;
+ }
+ }
+ };
+
+ // Handle computer change
+ const handleComputerChange = (computerId: string) => {
+ const computerInfo = state.computers.find((c) => c.id === computerId);
+ if (computerInfo) {
+ const { agentUrl, ...rest } = computerInfo;
+ const chatComputer: Computer = {
+ ...rest,
+ url: agentUrl,
+ } as Computer;
+ chatDispatch({ type: 'SET_COMPUTER', payload: chatComputer });
+ // Also update global state so VNC overlay can react to computer changes
+ playgroundDispatch({ type: 'SET_CURRENT_COMPUTER', payload: computerId });
+
+ // Warn if selecting an offline computer
+ if (computerInfo.status !== 'running') {
+ onToast?.(
+ 'Selected sandbox is not running. Please start it before sending messages.',
+ 'error'
+ );
+ }
+ }
+ };
+
+ // Handle input change
+ const handleInputChange = (value: string) => {
+ chatDispatch({ type: 'SET_INPUT', payload: value });
+ };
+
+ // Render VM status banner if provided
+ const vmStatusBanner = renderVMStatusBanner?.({
+ onRestartVM,
+ onStartVM,
+ hasOrg,
+ hasWorkspace,
+ hasCredits,
+ orgSlug,
+ computer,
+ computers,
+ });
+
+ // Centered layout for empty chat (no messages yet)
+ if (!hasMessages) {
+ return (
+ <motion.div
+ className={cn('flex flex-1 flex-col items-center justify-center p-6', className)}
+ initial={{ opacity: 0, y: -20 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: -40, transition: { duration: 0.2 } }}
+ transition={{ duration: 0.3, ease: 'easeOut' }}
+ >
+ <div className="w-full max-w-3xl">
+ {/* Logo and welcome text */}
+ <motion.div
+ className="mb-6 flex flex-col items-center text-center"
+ initial={{ opacity: 0, scale: 0.95 }}
+ animate={{ opacity: 1, scale: 1 }}
+ transition={{ duration: 0.3, delay: 0.1 }}
+ >
+ <img src={lightLogoUrl} className="mb-4 h-14 w-14 dark:hidden" alt="Logo" />
+ <img src={darkLogoUrl} className="mb-4 hidden h-14 w-14 dark:block" alt="Logo" />
+ <p className="text-lg text-neutral-700 dark:text-neutral-300">
+ How can I help you today?
+ </p>
+ {(!computer || !model) && (
+ <p className="mt-2 text-neutral-500 text-sm dark:text-neutral-400">
+ Make sure to select a model and sandbox!
+ </p>
+ )}
+ </motion.div>
+
+ {/* Input area */}
+ <motion.div
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.3, delay: 0.15 }}
+ >
+ {vmStatusBanner}
+ <ChatInput
+ currentInput={currentInput}
+ onInputChange={handleInputChange}
+ onSendMessage={handleSendMessage}
+ onStopResponse={handleStopResponse}
+ isGenerating={isGenerating}
+ computers={computers}
+ selectedComputer={selectedComputerForInput}
+ onComputerChange={handleComputerChange}
+ availableModels={state.availableModels}
+ selectedModel={model}
+ onModelChange={handleModelChange}
+ hasMessages={hasMessages}
+ isMobile={isMobile}
+ hasOrg={hasOrg}
+ hasWorkspace={hasWorkspace}
+ hasCredits={hasCredits}
+ orgSlug={orgSlug}
+ renderLink={renderLink}
+ />
+ </motion.div>
+
+ {/* Example prompts */}
+ <ExamplePrompts
+ onSelectPrompt={handleSelectPrompt}
+ onExamplePromptSelected={onExamplePromptSelected}
+ prompts={examplePrompts}
+ />
+ </div>
+ </motion.div>
+ );
+ }
+
+ // Normal layout with messages and input at bottom
+ return (
+ <div className={cn('flex flex-1 flex-col', className)}>
+ <ChatArea
+ onRetry={handleRetry}
+ onStopResponse={handleStopResponse}
+ onTimeout={handleTimeout}
+ />
+
+ <div className="flex-shrink-0 p-6">
+ <div className="mx-auto max-w-3xl">
+ {vmStatusBanner}
+ <ChatInput
+ currentInput={currentInput}
+ onInputChange={handleInputChange}
+ onSendMessage={handleSendMessage}
+ onStopResponse={handleStopResponse}
+ isGenerating={isGenerating}
+ computers={computers}
+ selectedComputer={selectedComputerForInput}
+ onComputerChange={handleComputerChange}
+ availableModels={state.availableModels}
+ selectedModel={model}
+ onModelChange={handleModelChange}
+ hasMessages={hasMessages}
+ isMobile={isMobile}
+ hasOrg={hasOrg}
+ hasWorkspace={hasWorkspace}
+ hasCredits={hasCredits}
+ orgSlug={orgSlug}
+ renderLink={renderLink}
+ />
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ChatList.tsx b/libs/typescript/playground/src/components/composed/ChatList.tsx
new file mode 100644
index 0000000000..cccea9e2df
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ChatList.tsx
@@ -0,0 +1,302 @@
+// Chat list component
+// Based on cloud/src/website/app/components/playground/ChatSidebar.tsx from main
+
+import { Download, Loader2, MoreVertical, Play, Plus, Trash } from 'lucide-react';
+import { useCallback, useState } from 'react';
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from '../ui/dialog';
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from '../ui/dropdown-menu';
+import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip';
+import {
+ useActiveChat,
+ useFindDefaultModel,
+ useIsChatGenerating,
+ usePlayground,
+} from '../../hooks/usePlayground';
+import type { Chat } from '../../types';
+import { cn } from '../../utils/cn';
+
+interface ChatListProps {
+ className?: string;
+ /** Callback when a new chat is created */
+ onCreateChat?: () => void;
+ /** Callback when a chat is selected (e.g., for mobile sidebar close) */
+ onChatSelect?: () => void;
+ /** Callback for exporting a chat */
+ onExportChat?: (chat: Chat) => void;
+ /** Callback for replaying a chat */
+ onReplayChat?: (chat: Chat) => void;
+ /** Toast callback for user notifications */
+ onToast?: (message: string, type?: 'success' | 'error' | 'info') => void;
+}
+
+export function ChatList({
+ className,
+ onCreateChat,
+ onChatSelect,
+ onExportChat,
+ onReplayChat,
+ onToast,
+}: ChatListProps) {
+ const { state, dispatch, adapters } = usePlayground();
+ const { chats, activeChatId } = state;
+ const activeChat = useActiveChat();
+ const defaultModel = useFindDefaultModel();
+ const [isCreating, setIsCreating] = useState(false);
+ const [deleteConfirmChat, setDeleteConfirmChat] = useState<Chat | null>(null);
+ const [isDeleting, setIsDeleting] = useState(false);
+
+ // Use global generating state (persists across chat switches)
+ const isGenerating = useIsChatGenerating(activeChatId);
+ const [loadingChatId, setLoadingChatId] = useState<string | null>(null);
+
+ const createChat = useCallback(async () => {
+ if (isCreating) return;
+ setIsCreating(true);
+
+ try {
+ // Create local chat object
+ const newChat: Chat = {
+ id: crypto.randomUUID(), // Temporary ID, adapter may replace it
+ name: 'New Chat',
+ messages: [],
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ };
+
+ // Save via adapter (may return chat with server-assigned ID)
+ const savedChat = await adapters.persistence.saveChat(newChat);
+
+ dispatch({ type: 'ADD_CHAT', payload: savedChat });
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: savedChat.id });
+
+ onCreateChat?.();
+ } catch (error) {
+ console.error('Failed to create chat:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to create chat: ${message}`, 'error');
+ } finally {
+ setIsCreating(false);
+ }
+ }, [defaultModel, dispatch, isCreating, adapters.persistence, onCreateChat, onToast]);
+
+ const handleDeleteConfirm = async () => {
+ if (!deleteConfirmChat) return;
+
+ setIsDeleting(true);
+ try {
+ await adapters.persistence.deleteChat(deleteConfirmChat.id);
+ dispatch({ type: 'DELETE_CHAT', payload: deleteConfirmChat.id });
+ setDeleteConfirmChat(null);
+ } catch (error) {
+ console.error('Failed to delete chat:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to delete chat: ${message}`, 'error');
+ } finally {
+ setIsDeleting(false);
+ }
+ };
+
+ const handleChatClick = async (chat: Chat) => {
+ // Set active chat immediately for responsive UI
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: chat.id });
+
+ // Load messages if adapter supports it and chat hasn't been loaded
+ if ((!chat.messages || chat.messages.length === 0) && adapters.persistence.loadChat) {
+ setLoadingChatId(chat.id);
+ try {
+ const fullChat = await adapters.persistence.loadChat(chat.id);
+ if (fullChat) {
+ dispatch({
+ type: 'SET_CHAT_MESSAGES',
+ payload: { id: chat.id, messages: fullChat.messages || [] },
+ });
+ }
+ } catch (error) {
+ console.error('Failed to load chat messages:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to load chat: ${message}`, 'error');
+ } finally {
+ setLoadingChatId(null);
+ }
+ }
+
+ onChatSelect?.();
+ };
+
+ const handleNewChatClick = () => {
+ // Don't create a new chat if the current chat is already blank
+ if (activeChat && (!activeChat.messages || activeChat.messages.length === 0)) {
+ return;
+ }
+ createChat();
+ onChatSelect?.();
+ };
+
+ // Determine button disabled state and reason
+ const isButtonDisabled = isGenerating || isCreating;
+ const disabledReason = isGenerating ? 'Wait for the current task to complete' : null;
+
+ const newChatButton = (
+ <button
+ type="button"
+ onClick={handleNewChatClick}
+ disabled={isButtonDisabled}
+ className="mb-6 flex w-full items-center justify-center gap-2 rounded-md border border-neutral-200 bg-white px-3 py-2 text-neutral-600 text-sm hover:bg-neutral-50 hover:text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-200"
+ >
+ {isCreating ? (
+ <>
+ <Loader2 className="h-4 w-4 animate-spin" />
+ Creating...
+ </>
+ ) : (
+ <>
+ <Plus className="h-4 w-4" />
+ New Chat
+ </>
+ )}
+ </button>
+ );
+
+ const sortedChats = [...chats].sort((a, b) => b.updated.getTime() - a.updated.getTime());
+
+ return (
+ <div className={cn('flex flex-col p-4', className)}>
+ {disabledReason ? (
+ <Tooltip>
+ <TooltipTrigger asChild>{newChatButton}</TooltipTrigger>
+ <TooltipContent>
+ <p>{disabledReason}</p>
+ </TooltipContent>
+ </Tooltip>
+ ) : (
+ newChatButton
+ )}
+
+ <div className="space-y-1">
+ <div className="mb-3 px-2 font-medium text-neutral-500 text-xs dark:text-neutral-400">
+ Task History
+ </div>
+ {sortedChats.map((chat) => (
+ <div
+ key={chat.id}
+ className={`group flex items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors ${
+ activeChat?.id === chat.id
+ ? 'bg-neutral-200 text-neutral-900 dark:bg-neutral-800 dark:text-white'
+ : 'text-neutral-600 hover:bg-neutral-100 dark:text-neutral-400 dark:hover:bg-neutral-800'
+ }`}
+ >
+ <button
+ type="button"
+ onClick={() => handleChatClick(chat)}
+ className="flex flex-1 items-center gap-2 truncate text-left"
+ >
+ {loadingChatId === chat.id && (
+ <Loader2 className="h-3 w-3 flex-shrink-0 animate-spin" />
+ )}
+ <span className="truncate">{chat.name}</span>
+ </button>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <button
+ type="button"
+ className="opacity-0 transition-opacity group-hover:opacity-100"
+ onClick={(e) => e.stopPropagation()}
+ >
+ <MoreVertical className="h-4 w-4 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300" />
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ {onReplayChat && (
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+ onReplayChat(chat);
+ }}
+ >
+ <Play className="mr-2 h-4 w-4" />
+ Replay
+ </DropdownMenuItem>
+ )}
+ {onExportChat && (
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+ onExportChat(chat);
+ }}
+ >
+ <Download className="mr-2 h-4 w-4" />
+ Export
+ </DropdownMenuItem>
+ )}
+ {(onReplayChat || onExportChat) && <DropdownMenuSeparator />}
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+ setDeleteConfirmChat(chat);
+ }}
+ className="text-red-600 focus:text-red-600 dark:text-red-400 dark:focus:text-red-400"
+ >
+ <Trash className="mr-2 h-4 w-4" />
+ Delete
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ ))}
+
+ {sortedChats.length === 0 && (
+ <div className="px-2 py-4 text-neutral-500 text-sm dark:text-neutral-400">
+ No chats yet
+ </div>
+ )}
+ </div>
+
+ <Dialog
+ open={!!deleteConfirmChat}
+ onOpenChange={(open) => !open && setDeleteConfirmChat(null)}
+ >
+ <DialogContent showCloseButton={false}>
+ <DialogHeader>
+ <DialogTitle>Delete Chat</DialogTitle>
+ <DialogDescription>
+ Are you sure you want to delete &ldquo;
+ {deleteConfirmChat?.name || 'this chat'}&rdquo;? This action cannot be undone.
+ </DialogDescription>
+ </DialogHeader>
+ <DialogFooter>
+ <button
+ type="button"
+ onClick={() => setDeleteConfirmChat(null)}
+ disabled={isDeleting}
+ className="rounded-md border border-neutral-200 bg-white px-4 py-2 text-neutral-700 text-sm transition-colors hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ onClick={handleDeleteConfirm}
+ disabled={isDeleting}
+ className="rounded-md bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700 disabled:opacity-50"
+ >
+ {isDeleting ? 'Deleting...' : 'Delete'}
+ </button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ChatPanel.tsx b/libs/typescript/playground/src/components/composed/ChatPanel.tsx
new file mode 100644
index 0000000000..46727446e0
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ChatPanel.tsx
@@ -0,0 +1,220 @@
+// Chat panel component
+// Adapted from cloud/src/website/app/components/playground/panels/ChatPanel.tsx
+
+import { useEffect, useRef, useState, type FormEvent } from 'react';
+import { motion } from 'motion/react';
+import { StopCircle, Send } from 'lucide-react';
+import {
+ usePlayground,
+ useChat,
+ useChatDispatch,
+ useIsChatGenerating,
+} from '../../hooks/usePlayground';
+import { useAgentRequest } from '../../hooks/useAgentRequest';
+import { ChatMessage } from '../primitives/ChatMessage';
+import { ToolCallsGroup } from '../primitives/ToolCallsGroup';
+import { ThinkingIndicator } from '../primitives/ThinkingIndicator';
+import type { Computer } from '../../types';
+import { cn } from '../../utils/cn';
+
+interface ChatPanelProps {
+ /** Optional class name for styling */
+ className?: string;
+ /** Optional callback when model changes */
+ onModelChange?: (modelId: string) => void;
+ /** Optional callback when computer changes */
+ onComputerChange?: (computerId: string) => void;
+}
+
+export function ChatPanel({ className, onModelChange, onComputerChange }: ChatPanelProps) {
+ const { state, dispatch: playgroundDispatch } = usePlayground();
+ const chatState = useChat();
+ const chatDispatch = useChatDispatch();
+ const { handleSendMessage, handleStopResponse } = useAgentRequest();
+
+ const isGenerating = useIsChatGenerating(chatState.id);
+ const chatContainerEnd = useRef<HTMLDivElement | null>(null);
+ const [stopping, setStopping] = useState(false);
+
+ // Scroll to bottom when messages change
+ useEffect(() => {
+ if (chatState.processedMessages.length > 0) {
+ setTimeout(() => chatContainerEnd.current?.scrollIntoView({ behavior: 'smooth' }), 100);
+ }
+ }, [chatState.processedMessages.length]);
+
+ const onSend = (e: FormEvent) => {
+ e.preventDefault();
+ if (!chatState.currentInput.trim()) return;
+ setStopping(false);
+ handleSendMessage();
+ };
+
+ const onStop = () => {
+ setStopping(true);
+ handleStopResponse();
+ };
+
+ const handleModelChange = (modelId: string) => {
+ // Find the model from available models
+ for (const provider of state.availableModels) {
+ const model = provider.models.find((m) => m.id === modelId);
+ if (model) {
+ chatDispatch({ type: 'SET_MODEL', payload: model });
+ onModelChange?.(modelId);
+ return;
+ }
+ }
+ };
+
+ const handleComputerChange = (computerId: string) => {
+ // Find the computer from available computers
+ // Note: We need to map from ComputerInfo to Computer type
+ const computer = state.computers.find((c) => c.id === computerId);
+ if (computer) {
+ // Convert ComputerInfo to Computer format for the chat state
+ const chatComputer: Computer = {
+ id: computer.id,
+ name: computer.name,
+ url: computer.agentUrl,
+ };
+ chatDispatch({ type: 'SET_COMPUTER', payload: chatComputer });
+ // Also update global state so VNC overlay can react to computer changes
+ playgroundDispatch({ type: 'SET_CURRENT_COMPUTER', payload: computerId });
+ onComputerChange?.(computerId);
+ }
+ };
+
+ return (
+ <div className={cn('flex h-full flex-col bg-white dark:bg-neutral-900', className)}>
+ {/* Header with model and computer selects */}
+ <div className="flex items-center justify-center gap-3 border-b px-4 py-3">
+ {/* Model Select */}
+ <select
+ value={chatState.model?.id || ''}
+ onChange={(e) => handleModelChange(e.target.value)}
+ className="w-1/2 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-600 dark:bg-neutral-800"
+ >
+ <option value="">Select a Model</option>
+ {state.availableModels.map((provider) => (
+ <optgroup key={provider.name} label={provider.name}>
+ {provider.models.map((model) => (
+ <option key={model.id} value={model.id}>
+ {model.name}
+ </option>
+ ))}
+ </optgroup>
+ ))}
+ </select>
+
+ {/* Computer Select */}
+ <select
+ value={state.currentComputerId || ''}
+ onChange={(e) => handleComputerChange(e.target.value)}
+ className="w-1/2 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-600 dark:bg-neutral-800"
+ >
+ <option value="">Select a Computer</option>
+ {state.computers.map((c) => (
+ <option key={c.id} value={c.id}>
+ {c.name}
+ </option>
+ ))}
+ </select>
+ </div>
+
+ {/* Chat Container */}
+ <div className="flex-1 overflow-auto px-6 pt-10 pb-2">
+ <div className="flex flex-col items-center">
+ <p className="text-neutral-700 dark:text-neutral-300">How can I help you today?</p>
+
+ <motion.div
+ key={chatState.id}
+ className="mt-8 flex w-full flex-col gap-4"
+ initial={{ opacity: 0, y: 20 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: -20 }}
+ transition={{ duration: 0.3, ease: 'easeInOut' }}
+ >
+ {chatState.processedMessages.length === 0
+ ? (!chatState.computer || !chatState.model) && (
+ <p className="mx-auto text-center text-neutral-500">
+ Select a model and computer to get started.
+ </p>
+ )
+ : chatState.processedMessages.map((item, index) => {
+ if (item.toolCalls && item.toolCalls.length > 0) {
+ return (
+ <div key={`group-${index}`}>
+ <ChatMessage message={item.message} screenshot={item.screenshot} />
+ <ToolCallsGroup toolCalls={item.toolCalls} />
+ </div>
+ );
+ }
+ return (
+ <ChatMessage
+ key={`msg-${index}`}
+ message={item.message}
+ screenshot={item.screenshot}
+ />
+ );
+ })}
+
+ {/* Generating indicator */}
+ {isGenerating && (
+ <div className="flex w-fit items-center gap-2 rounded-md border bg-neutral-50 p-2 dark:bg-neutral-800">
+ {!stopping && (
+ <button
+ type="button"
+ onClick={onStop}
+ className="rounded-md border p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700"
+ title="Stop the Agent"
+ >
+ <StopCircle className="h-5 w-5" />
+ </button>
+ )}
+ <p>{!stopping ? 'Processing' : 'Stopping'}</p>
+ <ThinkingIndicator />
+ </div>
+ )}
+
+ {/* Error display */}
+ {chatState.chatError && (
+ <div className="rounded-md border border-red-300 bg-red-50 p-3 text-red-800 dark:border-red-800 dark:bg-red-900/20 dark:text-red-300">
+ <p className="font-medium">Error</p>
+ <p className="text-sm">{chatState.chatError.message}</p>
+ </div>
+ )}
+
+ <div ref={chatContainerEnd} />
+ </motion.div>
+ </div>
+ </div>
+
+ {/* Input Area */}
+ <form onSubmit={onSend} className="flex items-end gap-2 border-t p-4">
+ <input
+ type="text"
+ placeholder="Enter your prompt here"
+ value={chatState.currentInput}
+ onChange={(e) => chatDispatch({ type: 'SET_INPUT', payload: e.target.value })}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' && !e.shiftKey) {
+ e.preventDefault();
+ onSend(e);
+ }
+ }}
+ className="flex-1 rounded-md border border-neutral-300 bg-white px-4 py-2 text-sm dark:border-neutral-600 dark:bg-neutral-800"
+ disabled={isGenerating}
+ />
+ <button
+ type="submit"
+ disabled={isGenerating || !chatState.currentInput.trim()}
+ className="rounded-md bg-neutral-900 p-2 text-white hover:bg-neutral-700 disabled:opacity-50 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-300"
+ title="Send your prompt"
+ >
+ <Send className="h-5 w-5" />
+ </button>
+ </form>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ChatSidebar.tsx b/libs/typescript/playground/src/components/composed/ChatSidebar.tsx
new file mode 100644
index 0000000000..5d0b23b22c
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ChatSidebar.tsx
@@ -0,0 +1,325 @@
+// ChatSidebar component
+// Adapted from cloud/src/website/app/components/playground/ChatSidebar.tsx
+
+import { Download, Loader2, MoreVertical, Play, Plus, Trash } from 'lucide-react';
+import { useCallback, useState } from 'react';
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from '../ui/dialog';
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from '../ui/dropdown-menu';
+import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip';
+import {
+ useActiveChat,
+ useFindDefaultModel,
+ useIsChatGenerating,
+ usePlayground,
+} from '../../hooks/usePlayground';
+import type { Chat, Computer } from '../../types';
+import { cn } from '../../utils/cn';
+
+interface ChatSidebarProps {
+ /** Custom class name */
+ className?: string;
+ /** Callback when a chat is selected (for mobile - close sidebar after selection) */
+ onChatSelect?: () => void;
+ /** Callback for exporting a chat */
+ onExportChat?: (chat: Chat) => void;
+ /** Callback for replaying a chat */
+ onReplayChat?: (chat: Chat) => void;
+ /** Optional toast callback */
+ onToast?: (message: string) => void;
+}
+
+export function ChatSidebar({
+ className,
+ onChatSelect,
+ onExportChat,
+ onReplayChat,
+ onToast,
+}: ChatSidebarProps) {
+ const { state, dispatch, adapters } = usePlayground();
+ const { chats, computers, activeChatId } = state;
+ const activeChat = useActiveChat();
+ const defaultModel = useFindDefaultModel();
+ const [isCreating, setIsCreating] = useState(false);
+ const [deleteConfirmChat, setDeleteConfirmChat] = useState<Chat | null>(null);
+ const [isDeleting, setIsDeleting] = useState(false);
+
+ // Use global generating state (persists across chat switches)
+ const isGenerating = useIsChatGenerating(activeChatId);
+ const [loadingChatId, setLoadingChatId] = useState<string | null>(null);
+
+ // Track loaded chats to avoid re-fetching
+ const [loadedChatIds, setLoadedChatIds] = useState<Set<string>>(new Set());
+
+ const createChat = useCallback(async () => {
+ if (isCreating) return;
+ setIsCreating(true);
+
+ try {
+ // Get first computer if available
+ const computer = computers.length > 0 ? computers[0] : undefined;
+ let computerAsChat: Computer | undefined;
+ if (computer) {
+ const { agentUrl, ...rest } = computer;
+ computerAsChat = {
+ ...rest,
+ url: agentUrl,
+ } as Computer;
+ }
+
+ // Create local chat object
+ const newChat: Chat = {
+ id: crypto.randomUUID(), // Temporary ID, adapter may replace it
+ name: 'New Chat',
+ messages: [],
+ computer: computerAsChat,
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ };
+
+ // Save via adapter (may return chat with server-assigned ID)
+ const savedChat = await adapters.persistence.saveChat(newChat);
+
+ dispatch({ type: 'ADD_CHAT', payload: savedChat });
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: savedChat.id });
+
+ // Mark as loaded since it's a new empty chat
+ setLoadedChatIds((prev) => new Set([...prev, savedChat.id]));
+ } catch (error) {
+ console.error('Failed to create chat:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to create chat: ${message}`);
+ } finally {
+ setIsCreating(false);
+ }
+ }, [computers, defaultModel, dispatch, isCreating, adapters.persistence, onToast]);
+
+ const handleDeleteConfirm = async () => {
+ if (!deleteConfirmChat) return;
+
+ setIsDeleting(true);
+ try {
+ await adapters.persistence.deleteChat(deleteConfirmChat.id);
+ dispatch({ type: 'DELETE_CHAT', payload: deleteConfirmChat.id });
+ setDeleteConfirmChat(null);
+ } catch (error) {
+ console.error('Failed to delete chat from DB:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to delete chat: ${message}`);
+ } finally {
+ setIsDeleting(false);
+ }
+ };
+
+ const handleChatClick = async (chat: Chat) => {
+ // Set active chat immediately for responsive UI
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: chat.id });
+
+ // Only fetch from DB if chat hasn't been loaded yet (cold start/page refresh).
+ // During a session, messages are kept in global state via setMessages(),
+ // so we don't need to re-fetch on every chat switch.
+ if (!loadedChatIds.has(chat.id)) {
+ setLoadingChatId(chat.id);
+
+ const loadMessages = async () => {
+ try {
+ if (adapters.persistence.loadChat) {
+ const fullChat = await adapters.persistence.loadChat(chat.id);
+ if (fullChat) {
+ dispatch({
+ type: 'SET_CHAT_MESSAGES',
+ payload: { id: chat.id, messages: fullChat.messages || [] },
+ });
+ setLoadedChatIds((prev) => new Set([...prev, chat.id]));
+ }
+ }
+ } catch (error) {
+ console.error('Failed to load chat messages:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to load chat: ${message}`);
+ }
+ };
+
+ await loadMessages();
+ setLoadingChatId(null);
+ }
+
+ onChatSelect?.();
+ };
+
+ const handleNewChatClick = () => {
+ // Don't create a new chat if the current chat is already blank
+ if (activeChat && (!activeChat.messages || activeChat.messages.length === 0)) {
+ return;
+ }
+ createChat();
+ onChatSelect?.();
+ };
+
+ // Determine button disabled state and reason
+ const isButtonDisabled = isGenerating || isCreating;
+ const disabledReason = isGenerating ? 'Wait for the current task to complete' : null;
+
+ const newChatButton = (
+ <button
+ type="button"
+ onClick={handleNewChatClick}
+ disabled={isButtonDisabled}
+ className="mb-6 flex w-full items-center justify-center gap-2 rounded-md border border-neutral-200 bg-white px-3 py-2 text-neutral-600 text-sm hover:bg-neutral-50 hover:text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-200"
+ >
+ {isCreating ? (
+ <>
+ <Loader2 className="h-4 w-4 animate-spin" />
+ Creating...
+ </>
+ ) : (
+ <>
+ <Plus className="h-4 w-4" />
+ New Chat
+ </>
+ )}
+ </button>
+ );
+
+ const sortedChats = [...chats].sort((a, b) => b.updated.getTime() - a.updated.getTime());
+
+ return (
+ <div className={cn('flex flex-col p-4', className)}>
+ {disabledReason ? (
+ <Tooltip>
+ <TooltipTrigger asChild>{newChatButton}</TooltipTrigger>
+ <TooltipContent>
+ <p>{disabledReason}</p>
+ </TooltipContent>
+ </Tooltip>
+ ) : (
+ newChatButton
+ )}
+
+ <div className="space-y-1">
+ <div className="mb-3 px-2 font-medium text-neutral-500 text-xs dark:text-neutral-400">
+ Task History
+ </div>
+ {sortedChats.map((chat) => (
+ <div
+ key={chat.id}
+ className={`group flex items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors ${
+ activeChat?.id === chat.id
+ ? 'bg-neutral-200 text-neutral-900 dark:bg-neutral-800 dark:text-white'
+ : 'text-neutral-600 hover:bg-neutral-100 dark:text-neutral-400 dark:hover:bg-neutral-800'
+ }`}
+ >
+ <button
+ type="button"
+ onClick={() => handleChatClick(chat)}
+ className="flex flex-1 items-center gap-2 truncate text-left"
+ >
+ {loadingChatId === chat.id && (
+ <Loader2 className="h-3 w-3 flex-shrink-0 animate-spin" />
+ )}
+ <span className="truncate">{chat.name}</span>
+ </button>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <button
+ type="button"
+ className="opacity-0 transition-opacity group-hover:opacity-100"
+ onClick={(e) => e.stopPropagation()}
+ >
+ <MoreVertical className="h-4 w-4 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300" />
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ {onReplayChat && (
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+ onReplayChat(chat);
+ }}
+ >
+ <Play className="mr-2 h-4 w-4" />
+ Replay
+ </DropdownMenuItem>
+ )}
+ {onExportChat && (
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+ onExportChat(chat);
+ }}
+ >
+ <Download className="mr-2 h-4 w-4" />
+ Export
+ </DropdownMenuItem>
+ )}
+ {(onReplayChat || onExportChat) && <DropdownMenuSeparator />}
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+ setDeleteConfirmChat(chat);
+ }}
+ className="text-red-600 focus:text-red-600 dark:text-red-400 dark:focus:text-red-400"
+ >
+ <Trash className="mr-2 h-4 w-4" />
+ Delete
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ ))}
+
+ {sortedChats.length === 0 && (
+ <div className="px-2 py-4 text-neutral-500 text-sm dark:text-neutral-400">
+ No chats yet
+ </div>
+ )}
+ </div>
+
+ <Dialog
+ open={!!deleteConfirmChat}
+ onOpenChange={(open) => !open && setDeleteConfirmChat(null)}
+ >
+ <DialogContent showCloseButton={false}>
+ <DialogHeader>
+ <DialogTitle>Delete Chat</DialogTitle>
+ <DialogDescription>
+ Are you sure you want to delete &ldquo;
+ {deleteConfirmChat?.name || 'this chat'}&rdquo;? This action cannot be undone.
+ </DialogDescription>
+ </DialogHeader>
+ <DialogFooter>
+ <button
+ type="button"
+ onClick={() => setDeleteConfirmChat(null)}
+ disabled={isDeleting}
+ className="rounded-md border border-neutral-200 bg-white px-4 py-2 text-neutral-700 text-sm transition-colors hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ onClick={handleDeleteConfirm}
+ disabled={isDeleting}
+ className="rounded-md bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700 disabled:opacity-50"
+ >
+ {isDeleting ? 'Deleting...' : 'Delete'}
+ </button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ChatSidebarSkeleton.tsx b/libs/typescript/playground/src/components/composed/ChatSidebarSkeleton.tsx
new file mode 100644
index 0000000000..e7e88ea5f1
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ChatSidebarSkeleton.tsx
@@ -0,0 +1,38 @@
+// ChatSidebarSkeleton component
+// Adapted from cloud/src/website/app/components/playground/ChatSidebarSkeleton.tsx
+
+import { Skeleton } from '../ui/skeleton';
+import { cn } from '../../utils/cn';
+
+interface ChatSidebarSkeletonProps {
+ /** Custom class name */
+ className?: string;
+ /** Number of chat item skeletons to show */
+ itemCount?: number;
+}
+
+export function ChatSidebarSkeleton({ className, itemCount = 5 }: ChatSidebarSkeletonProps) {
+ return (
+ <div className={cn('flex flex-col p-4', className)}>
+ {/* New Chat button skeleton */}
+ <Skeleton className="mb-6 h-9 w-full rounded-md" />
+
+ {/* Task History label */}
+ <div className="mb-3 px-2">
+ <Skeleton className="h-3 w-20" />
+ </div>
+
+ {/* Chat item skeletons */}
+ <div className="space-y-1">
+ {[...Array(itemCount)].map((_, i) => (
+ <div
+ key={`chat-skeleton-${i}`}
+ className="flex items-center gap-2 rounded-md px-2 py-1.5"
+ >
+ <Skeleton className="h-4 flex-1" />
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ComputerList.tsx b/libs/typescript/playground/src/components/composed/ComputerList.tsx
new file mode 100644
index 0000000000..33507c9c2c
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ComputerList.tsx
@@ -0,0 +1,294 @@
+// Computer list component
+// Adapted from cloud/src/website/app/components/playground/panels/ComputerList.tsx
+
+import { useState } from 'react';
+import { AnimatePresence, motion } from 'motion/react';
+import { Server, Globe, RefreshCcw, EllipsisVertical, Trash, Pen, CirclePlus } from 'lucide-react';
+import { usePlayground } from '../../hooks/usePlayground';
+import type { ComputerInfo } from '../../adapters/types';
+import { cn } from '../../utils/cn';
+
+interface ComputerListProps {
+ /** Optional class name for styling */
+ className?: string;
+ /** Optional callback when a computer is added */
+ onAddComputer?: () => void;
+ /** Optional callback when a computer is deleted */
+ onDeleteComputer?: (computer: ComputerInfo) => void;
+ /** Optional callback when a computer is renamed */
+ onRenameComputer?: (computer: ComputerInfo, newName: string) => void;
+}
+
+export function ComputerList({
+ className,
+ onAddComputer,
+ onDeleteComputer,
+ onRenameComputer,
+}: ComputerListProps) {
+ const { state, dispatch, adapters } = usePlayground();
+ const [menuOpenId, setMenuOpenId] = useState<string | null>(null);
+ const [showDeleteModal, setShowDeleteModal] = useState(false);
+ const [showRenameModal, setShowRenameModal] = useState(false);
+ const [selectedComputer, setSelectedComputer] = useState<ComputerInfo | null>(null);
+ const [newName, setNewName] = useState('');
+
+ const handleDelete = async (computer: ComputerInfo) => {
+ setSelectedComputer(computer);
+ setShowDeleteModal(true);
+ };
+
+ const handleRename = (computer: ComputerInfo) => {
+ setSelectedComputer(computer);
+ setNewName(computer.name);
+ setShowRenameModal(true);
+ };
+
+ const confirmDelete = async () => {
+ if (!selectedComputer) return;
+
+ // Remove from adapter if it supports it
+ if (selectedComputer.isCustom && adapters.computer.removeCustomComputer) {
+ try {
+ await adapters.computer.removeCustomComputer(selectedComputer.id);
+ } catch (error) {
+ console.error('Failed to remove computer:', error);
+ }
+ }
+
+ // Refresh computer list
+ const computers = await adapters.computer.listComputers();
+ dispatch({ type: 'SET_COMPUTERS', payload: computers });
+
+ onDeleteComputer?.(selectedComputer);
+ setShowDeleteModal(false);
+ setSelectedComputer(null);
+ };
+
+ const confirmRename = async () => {
+ if (!selectedComputer || !newName.trim()) return;
+
+ // Note: Renaming is handled by the parent - adapters don't support rename directly
+ onRenameComputer?.(selectedComputer, newName.trim());
+ setShowRenameModal(false);
+ setSelectedComputer(null);
+ setNewName('');
+ };
+
+ const getStatusColor = (status: string) => {
+ switch (status) {
+ case 'running':
+ return 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200';
+ case 'stopped':
+ return 'bg-neutral-100 text-neutral-800 dark:bg-neutral-600 dark:text-neutral-200';
+ case 'starting':
+ return 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200';
+ case 'error':
+ return 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200';
+ default:
+ return 'bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200';
+ }
+ };
+
+ return (
+ <div className={cn('flex h-full flex-col', className)}>
+ {/* Header */}
+ <div className="flex items-center justify-between border-b px-4 py-3">
+ <h2 className="font-semibold">Computers</h2>
+ {onAddComputer && (
+ <button
+ type="button"
+ onClick={onAddComputer}
+ className="rounded-md border p-2 hover:bg-neutral-50 dark:hover:bg-neutral-800"
+ title="Add Computer"
+ >
+ <CirclePlus className="h-4 w-4" />
+ </button>
+ )}
+ </div>
+
+ {/* Computer List */}
+ <ul className="flex-1 overflow-auto p-2">
+ <AnimatePresence>
+ {state.computers.map((computer) => (
+ <motion.li
+ key={computer.id}
+ layout
+ initial={{ opacity: 0, y: -20 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, x: -100 }}
+ transition={{ duration: 0.2, ease: 'easeOut' }}
+ className="relative mb-3 rounded-lg border bg-white p-3 dark:bg-neutral-800"
+ >
+ {/* Type Badge & Menu */}
+ <div className="absolute right-3 top-3 flex gap-1">
+ <div className="flex items-center gap-1 rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-600 dark:bg-neutral-700 dark:text-neutral-300">
+ {computer.isCustom ? (
+ <Globe className="h-3 w-3" />
+ ) : (
+ <Server className="h-3 w-3" />
+ )}
+ {computer.isCustom ? 'Custom' : 'VM'}
+ </div>
+
+ {computer.isCustom && (
+ <div className="relative">
+ <button
+ type="button"
+ onClick={() => setMenuOpenId(menuOpenId === computer.id ? null : computer.id)}
+ className="rounded-md p-1 hover:bg-neutral-200 dark:hover:bg-neutral-600"
+ >
+ <EllipsisVertical className="h-4 w-4" />
+ </button>
+
+ {menuOpenId === computer.id && (
+ <div className="absolute right-0 z-10 mt-1 w-32 rounded-md border bg-white shadow-lg dark:bg-neutral-800">
+ <button
+ type="button"
+ onClick={() => {
+ handleRename(computer);
+ setMenuOpenId(null);
+ }}
+ className="flex w-full items-center gap-2 px-3 py-2 text-sm hover:bg-neutral-50 dark:hover:bg-neutral-700"
+ >
+ <Pen className="h-4 w-4" /> Rename
+ </button>
+ <button
+ type="button"
+ onClick={() => {
+ handleDelete(computer);
+ setMenuOpenId(null);
+ }}
+ className="flex w-full items-center gap-2 px-3 py-2 text-sm text-red-600 hover:bg-neutral-50 dark:text-red-400 dark:hover:bg-neutral-700"
+ >
+ <Trash className="h-4 w-4" /> Delete
+ </button>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+
+ {/* Computer Info */}
+ <div className="flex flex-col gap-2">
+ <h3 className="pr-20 text-lg font-semibold text-neutral-900 dark:text-neutral-100">
+ {computer.name}
+ </h3>
+
+ <div className="flex flex-wrap gap-2 text-sm text-neutral-600 dark:text-neutral-400">
+ <div className="flex items-center gap-1">
+ <Globe className="h-4 w-4" />
+ <span className="truncate">{computer.agentUrl}</span>
+ </div>
+ </div>
+
+ {/* Status */}
+ <div className="flex items-center gap-2">
+ <span
+ className={cn(
+ 'flex items-center justify-center gap-2 rounded-full px-2 py-1 text-xs font-medium',
+ getStatusColor(computer.status)
+ )}
+ >
+ {computer.status === 'starting' && (
+ <RefreshCcw className="h-3 w-3 animate-spin" />
+ )}
+ {computer.status}
+ </span>
+ </div>
+ </div>
+ </motion.li>
+ ))}
+ </AnimatePresence>
+
+ {state.computers.length === 0 && (
+ <div className="flex flex-col items-center justify-center py-12 text-center">
+ <div className="mb-4 rounded-full bg-neutral-100 p-6 dark:bg-neutral-800">
+ <Server className="h-8 w-8 text-neutral-400" />
+ </div>
+ <h3 className="mb-2 text-lg font-medium text-neutral-900 dark:text-neutral-100">
+ No computers yet
+ </h3>
+ <p className="max-w-sm text-neutral-500 dark:text-neutral-400">
+ Add a computer to get started.
+ </p>
+ </div>
+ )}
+ </ul>
+
+ {/* Delete Modal */}
+ {showDeleteModal && (
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
+ <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-xl dark:bg-neutral-800">
+ <h3 className="text-lg font-semibold text-neutral-900 dark:text-neutral-100">
+ Delete Computer
+ </h3>
+ <p className="mt-2 text-sm text-neutral-600 dark:text-neutral-400">
+ Are you sure you want to delete "{selectedComputer?.name}"?
+ </p>
+ <div className="mt-4 flex justify-end gap-3">
+ <button
+ type="button"
+ onClick={() => {
+ setShowDeleteModal(false);
+ setSelectedComputer(null);
+ }}
+ className="rounded-md border px-4 py-2 hover:bg-neutral-50 dark:hover:bg-neutral-700"
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ onClick={confirmDelete}
+ className="rounded-md bg-red-600 px-4 py-2 text-white hover:bg-red-700"
+ >
+ Delete
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Rename Modal */}
+ {showRenameModal && (
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
+ <div className="w-full max-w-md rounded-lg bg-white p-6 shadow-xl dark:bg-neutral-800">
+ <h3 className="text-lg font-semibold text-neutral-900 dark:text-neutral-100">
+ Rename Computer
+ </h3>
+ <p className="mt-2 text-sm text-neutral-600 dark:text-neutral-400">
+ Enter a new name for "{selectedComputer?.name}".
+ </p>
+ <input
+ type="text"
+ value={newName}
+ onChange={(e) => setNewName(e.target.value)}
+ className="mt-3 w-full rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-600 dark:bg-neutral-700"
+ autoFocus
+ />
+ <div className="mt-4 flex justify-end gap-3">
+ <button
+ type="button"
+ onClick={() => {
+ setShowRenameModal(false);
+ setSelectedComputer(null);
+ setNewName('');
+ }}
+ className="rounded-md border px-4 py-2 hover:bg-neutral-50 dark:hover:bg-neutral-700"
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ onClick={confirmRename}
+ disabled={!newName.trim()}
+ className="rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:opacity-50"
+ >
+ Save
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/EmptyState.tsx b/libs/typescript/playground/src/components/composed/EmptyState.tsx
new file mode 100644
index 0000000000..8bc78c7378
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/EmptyState.tsx
@@ -0,0 +1,207 @@
+// Empty state component with chat input
+// Adapted from cloud/src/website/app/components/playground/EmptyState.tsx
+
+import { motion } from 'motion/react';
+import { useState } from 'react';
+import { ChatInput } from '../primitives/ChatInput';
+import { ExamplePrompts } from './ExamplePrompts';
+import { ChatProvider } from '../../context/ChatProvider';
+import { useChat, useChatDispatch, usePlayground } from '../../hooks/usePlayground';
+import type { Chat, Computer } from '../../types';
+
+interface EmptyStateWithInputProps {
+ /** Callback when user sends a message to create a new chat */
+ onCreateAndSend: (message: string) => Promise<void>;
+ /** Whether in mobile layout */
+ isMobile: boolean;
+ /** Draft chat for UI consistency */
+ draftChat: Chat;
+ /** Logo config for branding */
+ logo?: {
+ lightSrc: string;
+ darkSrc: string;
+ alt: string;
+ };
+ /** Custom welcome message */
+ welcomeMessage?: string;
+ /** Custom hint message when model/computer not selected */
+ selectionHint?: string;
+ /** Optional telemetry callback when example prompt is selected */
+ onExamplePromptSelected?: (promptId: string, promptTitle: string) => void;
+ /** Toast callback for user notifications */
+ onToast?: (message: string, type?: 'success' | 'error' | 'info') => void;
+}
+
+/**
+ * Empty state component with chat input - uses a draft chat for UI consistency
+ */
+export function EmptyStateWithInput({
+ onCreateAndSend,
+ isMobile,
+ draftChat,
+ logo,
+ welcomeMessage = 'How can I help you today?',
+ selectionHint = 'Make sure to select a model and sandbox!',
+ onExamplePromptSelected,
+ onToast,
+}: EmptyStateWithInputProps) {
+ return (
+ <ChatProvider chat={draftChat}>
+ <EmptyStateContent
+ onCreateAndSend={onCreateAndSend}
+ isMobile={isMobile}
+ logo={logo}
+ welcomeMessage={welcomeMessage}
+ selectionHint={selectionHint}
+ onExamplePromptSelected={onExamplePromptSelected}
+ onToast={onToast}
+ />
+ </ChatProvider>
+ );
+}
+
+interface EmptyStateContentProps {
+ onCreateAndSend: (message: string) => Promise<void>;
+ isMobile: boolean;
+ logo?: {
+ lightSrc: string;
+ darkSrc: string;
+ alt: string;
+ };
+ welcomeMessage: string;
+ selectionHint: string;
+ onExamplePromptSelected?: (promptId: string, promptTitle: string) => void;
+ onToast?: (message: string, type?: 'success' | 'error' | 'info') => void;
+}
+
+/**
+ * Inner component that uses ChatContext
+ */
+function EmptyStateContent({
+ onCreateAndSend,
+ isMobile,
+ logo,
+ welcomeMessage,
+ selectionHint,
+ onExamplePromptSelected,
+ onToast,
+}: EmptyStateContentProps) {
+ const chatState = useChat();
+ const chatDispatch = useChatDispatch();
+ const { state, dispatch: playgroundDispatch } = usePlayground();
+ const [isCreating, setIsCreating] = useState(false);
+
+ const handleSendMessage = async () => {
+ if (!chatState.currentInput.trim() || isCreating) return;
+ setIsCreating(true);
+ try {
+ await onCreateAndSend(chatState.currentInput.trim());
+ chatDispatch({ type: 'CLEAR_INPUT' });
+ } catch (error) {
+ console.error('Failed to create chat:', error);
+ const message = error instanceof Error ? error.message : 'Unknown error occurred';
+ onToast?.(`Failed to send message: ${message}`, 'error');
+ } finally {
+ setIsCreating(false);
+ }
+ };
+
+ const handleSelectPrompt = (prompt: string) => {
+ chatDispatch({ type: 'SET_INPUT', payload: prompt });
+ };
+
+ const handleInputChange = (value: string) => {
+ chatDispatch({ type: 'SET_INPUT', payload: value });
+ };
+
+ const handleModelChange = (modelId: string) => {
+ for (const provider of state.availableModels) {
+ const model = provider.models.find((m) => m.id === modelId);
+ if (model) {
+ chatDispatch({ type: 'SET_MODEL', payload: model });
+ return;
+ }
+ }
+ };
+
+ const handleComputerChange = (computerId: string) => {
+ const computerInfo = state.computers.find((c) => c.id === computerId);
+ if (computerInfo) {
+ const computer: Computer = {
+ id: computerInfo.id,
+ name: computerInfo.name,
+ url: computerInfo.agentUrl,
+ };
+ chatDispatch({ type: 'SET_COMPUTER', payload: computer });
+ // Also update global state so VNC overlay can react to computer changes
+ playgroundDispatch({ type: 'SET_CURRENT_COMPUTER', payload: computerId });
+ }
+ };
+
+ // Pass through computers with all properties (including vmId, status, etc.)
+ // The cloudAdapter already includes VM properties needed for status display
+ const computers: Computer[] = state.computers.map((c) => ({
+ ...c,
+ url: c.agentUrl,
+ })) as Computer[];
+
+ return (
+ <motion.div
+ className="flex flex-1 flex-col items-center justify-center p-6"
+ initial={{ opacity: 0, y: -20 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: -40, transition: { duration: 0.2 } }}
+ transition={{ duration: 0.3, ease: 'easeOut' }}
+ >
+ {/* Centered welcome message and input */}
+ <div className="w-full max-w-3xl">
+ {/* Logo and welcome text */}
+ <motion.div
+ className="mb-6 flex flex-col items-center text-center"
+ initial={{ opacity: 0, scale: 0.95 }}
+ animate={{ opacity: 1, scale: 1 }}
+ transition={{ duration: 0.3, delay: 0.1 }}
+ >
+ {logo && (
+ <>
+ <img src={logo.lightSrc} className="mb-4 h-14 w-14 dark:hidden" alt={logo.alt} />
+ <img src={logo.darkSrc} className="mb-4 hidden h-14 w-14 dark:block" alt={logo.alt} />
+ </>
+ )}
+ <p className="text-lg text-neutral-700 dark:text-neutral-300">{welcomeMessage}</p>
+ {(!chatState.computer || !chatState.model) && (
+ <p className="mt-2 text-neutral-500 text-sm dark:text-neutral-400">{selectionHint}</p>
+ )}
+ </motion.div>
+
+ {/* Input area */}
+ <motion.div
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.3, delay: 0.15 }}
+ >
+ <ChatInput
+ currentInput={chatState.currentInput}
+ onInputChange={handleInputChange}
+ onSendMessage={handleSendMessage}
+ onStopResponse={() => {}}
+ isGenerating={isCreating}
+ computers={computers}
+ selectedComputer={chatState.computer}
+ onComputerChange={handleComputerChange}
+ availableModels={state.availableModels}
+ selectedModel={chatState.model}
+ onModelChange={handleModelChange}
+ isMobile={isMobile}
+ />
+ </motion.div>
+
+ {/* Example prompts */}
+ <ExamplePrompts
+ onSelectPrompt={handleSelectPrompt}
+ onExamplePromptSelected={onExamplePromptSelected}
+ />
+ </div>
+ </motion.div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/ExamplePrompts.tsx b/libs/typescript/playground/src/components/composed/ExamplePrompts.tsx
new file mode 100644
index 0000000000..f6b3e19dc6
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/ExamplePrompts.tsx
@@ -0,0 +1,142 @@
+// Example prompts component
+// Adapted from cloud/src/website/app/components/playground/ExamplePrompts.tsx
+
+import { motion } from 'motion/react';
+import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip';
+
+export interface ExamplePrompt {
+ id: string;
+ title: string;
+ description: string;
+ icon: string; // Path to icon/logo
+ prompt: string;
+}
+
+export const EXAMPLE_PROMPTS: ExamplePrompt[] = [
+ {
+ id: 'job-application',
+ title: 'Job Application',
+ description: 'Apply to jobs on Ashby',
+ icon: '/img/logos/ashby.png',
+ prompt: `Help me apply to a job. Here's what I need you to do:
+
+1. Take a screenshot and assess the current screen state - look at what's currently visible.
+2. Open Firefox and visit https://www.overleaf.com/latex/templates/jakes-resume/syzfjbzwjncs.pdf
+3. Download the PDF by clicking the download button in the top right corner of the PDF viewer
+4. Once downloaded, navigate to https://www.ashbyhq.com/job_board_example_html/application-form-only.html?ashby_jid=dd883672-4381-4aed-a28d-09a2af002772
+5. Click on "First Posting" to open the job application form
+6. Fill out the application form with the following details:
+ - First Name: Jake
+ - Last Name: Ryan
+ - Phone: 123-456-7890
+7. Upload the resume PDF you downloaded earlier by clicking the resume upload field
+8. Complete any remaining required fields in the form
+9. Review all entered information to make sure it's correct
+10. Submit the application by clicking the submit button`,
+ },
+ {
+ id: 'yc-companies',
+ title: 'Browse YC Companies',
+ description: 'Explore latest Y Combinator startups',
+ icon: '/img/logos/yc.svg',
+ prompt: `Help me research the latest Y Combinator companies. Here's what I need you to do:
+
+1. Take a screenshot and assess the current screen state - look at what's currently visible.
+2. Open Firefox and visit https://www.ycombinator.com/companies
+3. Click on the "Batch" filter dropdown and select the most recent batch (e.g., W25 or S24)
+4. Browse through the list of companies in this batch
+5. For each of the first 5 companies you see:
+ - Click on the company to view their details page
+ - Note down the company name
+ - Note down what they do (their one-line description)
+ - Note down the names of the founders listed
+ - Navigate back to the companies list
+6. Open a text editor application
+7. Create a CSV file with the following columns: Company Name, Description, Founders
+8. Enter the information for all 5 companies you researched
+9. Save the file as "yc_companies.csv" on the desktop`,
+ },
+ {
+ id: 'install-claude-code',
+ title: 'Install Claude Code',
+ description: 'Set up Claude Code on this machine',
+ icon: '/img/logos/claude-code.png',
+ prompt: `Help me install Claude Code on this machine. Here's what I need you to do:
+
+1. Take a screenshot and assess the current screen state - look at what's currently visible.
+2. Open Firefox and visit https://docs.anthropic.com/en/docs/claude-code/overview
+3. Look for the installation instructions on the page
+4. Open the Terminal application
+5. Check if Node.js is installed by running: node --version
+6. If Node.js is not installed (command not found), visit https://nodejs.org and download the LTS version installer, then run the installer
+7. Once Node.js is confirmed installed, install Claude Code globally by running: npm install -g @anthropic-ai/claude-code
+8. Wait for the installation to complete
+9. Verify the installation was successful by running: claude --version
+10. The output should show the Claude Code version number, confirming it's installed correctly`,
+ },
+];
+
+interface ExamplePromptsProps {
+ /** Callback when a prompt is selected */
+ onSelectPrompt: (prompt: string) => void;
+ /** Optional telemetry callback when example prompt is selected */
+ onExamplePromptSelected?: (promptId: string, promptTitle: string) => void;
+ /** Custom prompts to display (defaults to EXAMPLE_PROMPTS) */
+ prompts?: ExamplePrompt[];
+}
+
+export function ExamplePrompts({
+ onSelectPrompt,
+ onExamplePromptSelected,
+ prompts = EXAMPLE_PROMPTS,
+}: ExamplePromptsProps) {
+ const handleSelectPrompt = (example: ExamplePrompt) => {
+ onExamplePromptSelected?.(example.id, example.title);
+ onSelectPrompt(example.prompt);
+ };
+
+ return (
+ <motion.div
+ className="mt-6 flex w-full flex-col items-center gap-2"
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.3, delay: 0.2 }}
+ >
+ <div className="flex flex-wrap justify-center gap-2">
+ {prompts.map((example, index) => (
+ <Tooltip key={example.id}>
+ <TooltipTrigger asChild>
+ <motion.button
+ type="button"
+ onClick={() => handleSelectPrompt(example)}
+ className="group flex items-center gap-2 rounded-full border border-neutral-200 bg-white px-3 py-1.5 text-left transition-all hover:border-neutral-300 hover:bg-neutral-50 hover:shadow-sm dark:border-neutral-700 dark:bg-neutral-800 dark:hover:border-neutral-600 dark:hover:bg-neutral-700"
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.2, delay: 0.25 + index * 0.05 }}
+ whileHover={{ scale: 1.02 }}
+ whileTap={{ scale: 0.98 }}
+ >
+ <img
+ src={example.icon}
+ alt=""
+ className="h-4 w-4 object-contain"
+ onError={(e) => {
+ e.currentTarget.style.display = 'none';
+ }}
+ />
+ <span className="font-medium text-neutral-700 text-sm dark:text-neutral-200">
+ {example.title}
+ </span>
+ </motion.button>
+ </TooltipTrigger>
+ <TooltipContent sideOffset={8}>{example.description}</TooltipContent>
+ </Tooltip>
+ ))}
+ </div>
+ <p className="mt-1 text-neutral-400 text-xs dark:text-neutral-500">
+ More example prompts coming soon...
+ </p>
+ </motion.div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/PlaygroundContent.tsx b/libs/typescript/playground/src/components/composed/PlaygroundContent.tsx
new file mode 100644
index 0000000000..3d1b8f955a
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/PlaygroundContent.tsx
@@ -0,0 +1,303 @@
+// Main playground content component
+// Adapted from cloud/src/website/app/components/playground/PlaygroundContent.tsx
+
+import { AnimatePresence, motion } from 'motion/react';
+import { useEffect, useMemo, useRef, useState } from 'react';
+import { EmptyStateWithInput } from './EmptyState';
+import { PlaygroundLayout } from './PlaygroundLayout';
+import { ChatProvider } from '../../context/ChatProvider';
+import {
+ useActiveChat,
+ useFindDefaultModel,
+ useIsChatGenerating,
+ usePlayground,
+} from '../../hooks/usePlayground';
+import type { Chat, Computer } from '../../types';
+
+// Re-export for convenience
+export { EmptyStateWithInput } from './EmptyState';
+export { ExamplePrompts, EXAMPLE_PROMPTS, type ExamplePrompt } from './ExamplePrompts';
+export { PlaygroundLayout } from './PlaygroundLayout';
+
+interface PlaygroundContentProps {
+ /** Content to render when a chat is active */
+ renderChatContent: (props: {
+ chat: Chat;
+ isGenerating: boolean;
+ isMobile: boolean;
+ shouldAutoSendFirstMessage: boolean;
+ onAutoSendComplete: () => void;
+ }) => React.ReactNode;
+
+ /** Whether dark mode is enabled */
+ isDarkMode?: boolean;
+ /** Callback to toggle theme */
+ onToggleTheme?: () => void;
+ /** Custom render function for theme toggle (for animated toggles) */
+ renderThemeToggle?: (props: { isDarkMode: boolean; onToggle: () => void }) => React.ReactNode;
+ /** Render function for custom link */
+ renderLink?: (props: {
+ to: string;
+ children: React.ReactNode;
+ className?: string;
+ }) => React.ReactNode;
+ /** Custom back link URL */
+ backLinkUrl?: string;
+ /** Custom back link text */
+ backLinkText?: string;
+ /** Whether to show the preview badge */
+ showPreviewBadge?: boolean;
+
+ /** Callback for export action */
+ onExportChat?: (chat: Chat) => void;
+ /** Callback for replay action */
+ onReplayChat?: (chat: Chat) => void;
+
+ /** Optional loading bar component */
+ loadingBar?: React.ReactNode;
+ /** Optional sidebar skeleton component */
+ sidebarSkeleton?: React.ReactNode;
+ /** Optional VNC overlay panel */
+ vncOverlayPanel?: React.ReactNode;
+ /** Whether chats are loading */
+ chatsLoading?: boolean;
+
+ /** Optional settings modal */
+ settingsModal?: React.ReactNode;
+
+ /** Logo config for empty state branding */
+ logo?: {
+ lightSrc: string;
+ darkSrc: string;
+ alt: string;
+ };
+ /** Custom welcome message for empty state */
+ welcomeMessage?: string;
+ /** Custom hint message for empty state */
+ selectionHint?: string;
+
+ /** Optional telemetry callback for page view */
+ onPlaygroundViewed?: () => void;
+ /** Optional telemetry callback when example prompt is selected */
+ onExamplePromptSelected?: (promptId: string, promptTitle: string) => void;
+ /** Optional toast callback */
+ onToast?: (message: string, type?: 'success' | 'error' | 'info') => void;
+}
+
+/**
+ * Main content component for the playground - handles all the business logic
+ */
+export function PlaygroundContent({
+ renderChatContent,
+ isDarkMode,
+ onToggleTheme,
+ renderThemeToggle,
+ renderLink,
+ backLinkUrl,
+ backLinkText,
+ showPreviewBadge,
+ onExportChat,
+ onReplayChat,
+ loadingBar,
+ sidebarSkeleton,
+ vncOverlayPanel,
+ chatsLoading = false,
+ settingsModal,
+ logo,
+ welcomeMessage,
+ selectionHint,
+ onPlaygroundViewed,
+ onExamplePromptSelected,
+ onToast,
+}: PlaygroundContentProps) {
+ const { state, dispatch, adapters } = usePlayground();
+ const activeChat = useActiveChat();
+ const isActiveChatGenerating = useIsChatGenerating(activeChat?.id ?? null);
+ const defaultModel = useFindDefaultModel();
+ const [isMobile, setIsMobile] = useState(false);
+ // Track chat IDs that need to auto-send their first message
+ const pendingFirstMessageRef = useRef<Set<string>>(new Set());
+
+ const { initialized, computers } = state;
+
+ // Track playground page view for analytics (optional)
+ useEffect(() => {
+ onPlaygroundViewed?.();
+ }, [onPlaygroundViewed]);
+
+ // Check if mobile on mount
+ useEffect(() => {
+ const checkMobile = () => {
+ setIsMobile(window.innerWidth < 768);
+ };
+ checkMobile();
+ window.addEventListener('resize', checkMobile);
+ return () => window.removeEventListener('resize', checkMobile);
+ }, []);
+
+ // Auto-select model for active chat if missing
+ useEffect(() => {
+ if (!initialized || !activeChat || activeChat.model) return;
+ if (defaultModel) {
+ dispatch({
+ type: 'UPDATE_CHAT',
+ payload: { id: activeChat.id, updates: { model: defaultModel } },
+ });
+ }
+ }, [initialized, activeChat, defaultModel, dispatch]);
+
+ // Create a new chat and send the first message
+ const handleCreateChatWithMessage = async (message: string) => {
+ // Find a running computer first, then fall back to first computer
+ const runningComputer = computers.find((c) => c.status === 'running');
+ const computerInfo = runningComputer ?? computers[0];
+
+ if (!computerInfo) {
+ onToast?.('Please select a sandbox to interact with.', 'error');
+ return;
+ }
+
+ // Convert ComputerInfo to Computer
+ const computer: Computer = {
+ id: computerInfo.id,
+ name: computerInfo.name,
+ url: computerInfo.agentUrl,
+ };
+
+ try {
+ // Create chat title from first message
+ const base = message.trim().replace(/\s+/g, ' ');
+ const maxLen = 60;
+ const title = base.length > maxLen ? `${base.slice(0, maxLen)}...` : base || 'New Chat';
+
+ // Create the first message
+ const userMessage = {
+ content: message,
+ role: 'user' as const,
+ type: 'message' as const,
+ };
+
+ const newChat: Chat = {
+ id: crypto.randomUUID(),
+ name: title,
+ messages: [userMessage],
+ computer,
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ };
+
+ // Save via adapter (may return chat with server-assigned ID)
+ const savedChat = await adapters.persistence.saveChat(newChat);
+
+ // Add chat to state and set as active
+ dispatch({ type: 'ADD_CHAT', payload: savedChat });
+ dispatch({ type: 'SET_ACTIVE_CHAT_ID', payload: savedChat.id });
+
+ // Mark this chat as needing to auto-send its first message
+ pendingFirstMessageRef.current.add(savedChat.id);
+
+ // Persist the first message
+ adapters.persistence.saveMessages(savedChat.id, [userMessage]).catch(console.error);
+ } catch (error) {
+ console.error('Failed to create chat:', error);
+ onToast?.('Failed to create chat', 'error');
+ }
+ };
+
+ // Create a draft chat for the empty state (not persisted until first message)
+ const draftChat = useMemo<Chat>(() => {
+ const runningComputer = computers.find((c) => c.status === 'running');
+ const computerInfo = runningComputer ?? computers[0];
+
+ // Convert ComputerInfo to Computer if available
+ const computer: Computer | undefined = computerInfo
+ ? {
+ id: computerInfo.id,
+ name: computerInfo.name,
+ url: computerInfo.agentUrl,
+ }
+ : undefined;
+
+ return {
+ id: 'draft',
+ name: 'New Chat',
+ messages: [],
+ computer,
+ model: defaultModel,
+ created: new Date(),
+ updated: new Date(),
+ };
+ }, [computers, defaultModel]);
+
+ // Check if active chat needs to auto-send its first message
+ const shouldAutoSend = activeChat ? pendingFirstMessageRef.current.has(activeChat.id) : false;
+
+ const clearPendingFirstMessage = (chatId: string) => {
+ pendingFirstMessageRef.current.delete(chatId);
+ };
+
+ // Render content based on whether there's an active chat
+ const renderContent = () => {
+ return (
+ <AnimatePresence mode="wait">
+ {!activeChat ? (
+ <EmptyStateWithInput
+ key="empty-state"
+ onCreateAndSend={handleCreateChatWithMessage}
+ isMobile={isMobile}
+ draftChat={draftChat}
+ logo={logo}
+ welcomeMessage={welcomeMessage}
+ selectionHint={selectionHint}
+ onExamplePromptSelected={onExamplePromptSelected}
+ onToast={onToast}
+ />
+ ) : (
+ <motion.div
+ key={`chat-${activeChat.id}`}
+ className="flex flex-1 flex-col overflow-hidden"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ transition={{ duration: 0.2 }}
+ >
+ <ChatProvider chat={activeChat} isGenerating={isActiveChatGenerating}>
+ {renderChatContent({
+ chat: activeChat,
+ isGenerating: isActiveChatGenerating,
+ isMobile,
+ shouldAutoSendFirstMessage: shouldAutoSend,
+ onAutoSendComplete: () => clearPendingFirstMessage(activeChat.id),
+ })}
+ </ChatProvider>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ );
+ };
+
+ return (
+ <>
+ <PlaygroundLayout
+ isDarkMode={isDarkMode}
+ onToggleTheme={onToggleTheme}
+ renderThemeToggle={renderThemeToggle}
+ renderLink={renderLink}
+ backLinkUrl={backLinkUrl}
+ backLinkText={backLinkText}
+ showPreviewBadge={showPreviewBadge}
+ onExportChat={onExportChat}
+ onReplayChat={onReplayChat}
+ loadingBar={loadingBar}
+ sidebarSkeleton={sidebarSkeleton}
+ vncOverlayPanel={vncOverlayPanel}
+ chatsLoading={chatsLoading}
+ onToast={onToast}
+ >
+ {renderContent()}
+ </PlaygroundLayout>
+
+ {settingsModal}
+ </>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/PlaygroundLayout.tsx b/libs/typescript/playground/src/components/composed/PlaygroundLayout.tsx
new file mode 100644
index 0000000000..64649f7a57
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/PlaygroundLayout.tsx
@@ -0,0 +1,257 @@
+// Playground layout component
+// Adapted from cloud/src/website/app/components/playground/PlaygroundLayout.tsx
+
+import {
+ ArrowLeft,
+ Download,
+ Menu,
+ Moon,
+ PanelLeftClose,
+ PanelLeftOpen,
+ Play,
+ Sun,
+ X,
+} from 'lucide-react';
+import { motion } from 'motion/react';
+import { type ReactNode, useEffect, useState } from 'react';
+import { ChatList } from './ChatList';
+import { useActiveChat, usePlayground } from '../../hooks/usePlayground';
+import type { Chat } from '../../types';
+
+interface PlaygroundLayoutProps {
+ /** Main content to render */
+ children: ReactNode;
+ /** Whether dark mode is enabled */
+ isDarkMode?: boolean;
+ /** Callback to toggle theme */
+ onToggleTheme?: () => void;
+ /** Custom render function for theme toggle (for animated toggles) */
+ renderThemeToggle?: (props: { isDarkMode: boolean; onToggle: () => void }) => ReactNode;
+ /** Render function for custom link (e.g., react-router Link) */
+ renderLink?: (props: { to: string; children: ReactNode; className?: string }) => ReactNode;
+ /** Custom back link URL (defaults to '/dashboard') */
+ backLinkUrl?: string;
+ /** Custom back link text (defaults to 'Back to Dashboard') */
+ backLinkText?: string;
+ /** Whether to show the preview badge */
+ showPreviewBadge?: boolean;
+ /** Callback for export action */
+ onExportChat?: (chat: Chat) => void;
+ /** Callback for replay action */
+ onReplayChat?: (chat: Chat) => void;
+ /** Optional loading bar component */
+ loadingBar?: ReactNode;
+ /** Optional sidebar skeleton component */
+ sidebarSkeleton?: ReactNode;
+ /** Optional VNC overlay panel */
+ vncOverlayPanel?: ReactNode;
+ /** Whether chats are loading */
+ chatsLoading?: boolean;
+ /** Callback when chat is selected */
+ onChatSelect?: () => void;
+ /** Toast callback for user notifications */
+ onToast?: (message: string, type?: 'success' | 'error' | 'info') => void;
+}
+
+export function PlaygroundLayout({
+ children,
+ isDarkMode = false,
+ onToggleTheme,
+ renderThemeToggle,
+ renderLink,
+ backLinkUrl = '/dashboard',
+ backLinkText = 'Back to Dashboard',
+ showPreviewBadge = true,
+ onExportChat,
+ onReplayChat,
+ loadingBar,
+ sidebarSkeleton,
+ vncOverlayPanel,
+ chatsLoading = false,
+ onChatSelect,
+ onToast,
+}: PlaygroundLayoutProps) {
+ const { state, dispatch } = usePlayground();
+ const { isSidebarCollapsed } = state;
+ const activeChat = useActiveChat();
+ const [isMobileSidebarOpen, setIsMobileSidebarOpen] = useState(false);
+ const [isMobile, setIsMobile] = useState(false);
+
+ // Check if mobile on mount and window resize
+ useEffect(() => {
+ const checkMobile = () => {
+ setIsMobile(window.innerWidth < 768); // 768px is md breakpoint
+ };
+
+ checkMobile();
+ window.addEventListener('resize', checkMobile);
+ return () => window.removeEventListener('resize', checkMobile);
+ }, []);
+
+ const handleSidebarToggle = () => {
+ dispatch({ type: 'TOGGLE_SIDEBAR' });
+ };
+
+ const handleChatSelect = () => {
+ setIsMobileSidebarOpen(false);
+ onChatSelect?.();
+ };
+
+ // Default link renderer (just renders an anchor)
+ const defaultRenderLink = ({
+ to,
+ children,
+ className,
+ }: {
+ to: string;
+ children: ReactNode;
+ className?: string;
+ }) => (
+ <a href={to} className={className}>
+ {children}
+ </a>
+ );
+
+ const LinkComponent = renderLink || defaultRenderLink;
+
+ return (
+ <div className="relative flex h-screen w-screen flex-col overflow-hidden bg-white dark:bg-[#0C0C0C]">
+ {loadingBar}
+
+ {/* Top header bar */}
+ <div className="flex h-12 flex-shrink-0 items-center justify-between border-neutral-200 border-b bg-white px-4 dark:border-neutral-800 dark:bg-[#0C0C0C]">
+ <LinkComponent
+ to={backLinkUrl}
+ className="flex items-center gap-2 text-neutral-600 text-sm transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-white"
+ >
+ <ArrowLeft className="h-4 w-4" />
+ <span>{backLinkText}</span>
+ </LinkComponent>
+
+ <div className="flex items-center gap-3">
+ {/* Replay and Export buttons - only show when there's an active chat with messages */}
+ {activeChat?.messages && activeChat.messages.length > 0 && (
+ <>
+ {onReplayChat && (
+ <button
+ type="button"
+ onClick={() => onReplayChat(activeChat)}
+ className="flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-neutral-600 text-sm transition-colors hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-white"
+ title="Replay trajectory"
+ >
+ <Play className="h-4 w-4" />
+ <span className="hidden sm:inline">Replay</span>
+ </button>
+ )}
+ {onExportChat && (
+ <button
+ type="button"
+ onClick={() => onExportChat(activeChat)}
+ className="flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-neutral-600 text-sm transition-colors hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-white"
+ title="Export trajectory"
+ >
+ <Download className="h-4 w-4" />
+ <span className="hidden sm:inline">Export</span>
+ </button>
+ )}
+ </>
+ )}
+
+ {/* Preview label */}
+ {showPreviewBadge && (
+ <div className="flex h-7 items-center rounded-full border border-blue-500/20 bg-blue-500/10 px-3 font-medium text-blue-600 text-xs dark:border-blue-500/30 dark:bg-blue-500/20 dark:text-blue-400">
+ Preview
+ </div>
+ )}
+
+ {/* Theme toggle button */}
+ {onToggleTheme &&
+ (renderThemeToggle ? (
+ renderThemeToggle({ isDarkMode, onToggle: onToggleTheme })
+ ) : (
+ <button
+ type="button"
+ onClick={onToggleTheme}
+ className="flex h-8 w-8 items-center justify-center rounded-md text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-white"
+ aria-label="Toggle theme"
+ >
+ {isDarkMode ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ {/* Mobile menu button - top left corner, only visible on mobile */}
+ <button
+ type="button"
+ onClick={() => setIsMobileSidebarOpen(!isMobileSidebarOpen)}
+ className="absolute top-16 left-4 z-50 flex h-10 w-10 items-center justify-center rounded-full bg-neutral-100 text-neutral-600 transition-colors hover:bg-neutral-200 hover:text-neutral-900 md:hidden dark:bg-neutral-800 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-white"
+ >
+ {isMobileSidebarOpen ? <X className="h-5 w-5" /> : <Menu className="h-5 w-5" />}
+ </button>
+
+ <div className="flex flex-1 overflow-hidden">
+ {/* Mobile backdrop overlay */}
+ {isMobileSidebarOpen && (
+ <motion.button
+ type="button"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ exit={{ opacity: 0 }}
+ transition={{ duration: 0.2 }}
+ className="absolute inset-0 z-40 bg-black/50 md:hidden"
+ onClick={() => setIsMobileSidebarOpen(false)}
+ aria-label="Close sidebar"
+ />
+ )}
+
+ {/* Sidebar - Chat history */}
+ <motion.div
+ animate={{
+ width: isSidebarCollapsed ? 0 : 288,
+ x: isMobile ? (isMobileSidebarOpen ? 0 : -288) : 0,
+ opacity: isSidebarCollapsed ? 0 : 1,
+ }}
+ transition={{ duration: 0.3, ease: [0.4, 0, 0.2, 1] }}
+ className="absolute inset-y-0 left-0 z-50 w-72 overflow-hidden border-neutral-200 border-r bg-neutral-50 p-4 pt-16 md:relative md:z-auto md:p-4 md:pt-4 dark:border-neutral-800 dark:bg-[#0C0C0C]"
+ style={{
+ padding: isSidebarCollapsed ? 0 : undefined,
+ }}
+ >
+ {chatsLoading && sidebarSkeleton ? (
+ sidebarSkeleton
+ ) : (
+ <ChatList
+ onChatSelect={handleChatSelect}
+ onExportChat={onExportChat}
+ onReplayChat={onReplayChat}
+ onToast={onToast}
+ />
+ )}
+ </motion.div>
+
+ {/* Main content area */}
+ <div className="relative flex flex-1 flex-col overflow-hidden">
+ {/* Collapse/Expand button - positioned at the top left of content area */}
+ {!isMobile && (
+ <button
+ type="button"
+ onClick={handleSidebarToggle}
+ className="absolute top-3 left-3 z-[60] flex h-8 w-8 items-center justify-center rounded-full text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-500 dark:hover:bg-neutral-800 dark:hover:text-white"
+ >
+ {isSidebarCollapsed ? (
+ <PanelLeftOpen className="h-4 w-4" />
+ ) : (
+ <PanelLeftClose className="h-4 w-4" />
+ )}
+ </button>
+ )}
+ {children}
+ </div>
+ </div>
+
+ {/* VNC overlay panel slot */}
+ {vncOverlayPanel}
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/composed/index.ts b/libs/typescript/playground/src/components/composed/index.ts
new file mode 100644
index 0000000000..4702d7b4e8
--- /dev/null
+++ b/libs/typescript/playground/src/components/composed/index.ts
@@ -0,0 +1,12 @@
+// Barrel export for composed components
+export { ChatPanel } from './ChatPanel';
+export { ChatList } from './ChatList';
+export { ChatArea } from './ChatArea';
+export { ChatContent } from './ChatContent';
+export { ChatSidebar } from './ChatSidebar';
+export { ChatSidebarSkeleton } from './ChatSidebarSkeleton';
+export { ComputerList } from './ComputerList';
+export { EmptyStateWithInput } from './EmptyState';
+export { ExamplePrompts, EXAMPLE_PROMPTS, type ExamplePrompt } from './ExamplePrompts';
+export { PlaygroundLayout } from './PlaygroundLayout';
+export { PlaygroundContent } from './PlaygroundContent';
diff --git a/libs/typescript/playground/src/components/modals/CustomComputerModal.tsx b/libs/typescript/playground/src/components/modals/CustomComputerModal.tsx
new file mode 100644
index 0000000000..57dc333851
--- /dev/null
+++ b/libs/typescript/playground/src/components/modals/CustomComputerModal.tsx
@@ -0,0 +1,166 @@
+// Custom computer modal component
+// Adapted from cloud/src/website/app/components/playground/modals/CustomComputerModal.tsx
+
+import { useState } from 'react';
+import { X } from 'lucide-react';
+import { usePlayground } from '../../hooks/usePlayground';
+import type { ComputerInfo } from '../../adapters/types';
+import { cn } from '../../utils/cn';
+
+interface CustomComputerModalProps {
+ /** Whether the modal is open */
+ isOpen: boolean;
+ /** Callback to close the modal */
+ onClose: () => void;
+ /** Optional callback when a computer is added */
+ onAdd?: (computer: ComputerInfo) => void;
+ /** Optional class name for the modal content */
+ className?: string;
+}
+
+export function CustomComputerModal({
+ isOpen,
+ onClose,
+ onAdd,
+ className,
+}: CustomComputerModalProps) {
+ const { adapters, dispatch } = usePlayground();
+ const [name, setName] = useState('');
+ const [url, setUrl] = useState('');
+ const [isLoading, setIsLoading] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault();
+ setError(null);
+
+ if (!name.trim() || !url.trim()) {
+ setError('Please fill in all fields');
+ return;
+ }
+
+ // Validate URL format
+ try {
+ new URL(url);
+ } catch {
+ setError('Please enter a valid URL');
+ return;
+ }
+
+ setIsLoading(true);
+
+ try {
+ // Add computer via adapter
+ if (adapters.computer.addCustomComputer) {
+ const newComputer = await adapters.computer.addCustomComputer({
+ name: name.trim(),
+ vncUrl: `${url.trim()}/vnc`,
+ agentUrl: url.trim(),
+ status: 'running',
+ isCustom: true,
+ });
+
+ // Refresh computer list
+ const computers = await adapters.computer.listComputers();
+ dispatch({ type: 'SET_COMPUTERS', payload: computers });
+
+ onAdd?.(newComputer);
+ onClose();
+ setName('');
+ setUrl('');
+ } else {
+ setError('Adding custom computers is not supported');
+ }
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'Failed to add computer');
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ if (!isOpen) return null;
+
+ return (
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
+ <div
+ className={cn(
+ 'relative w-full max-w-md rounded-lg bg-white p-6 shadow-xl dark:bg-neutral-800',
+ className
+ )}
+ >
+ {/* Close button */}
+ <button
+ type="button"
+ onClick={onClose}
+ className="absolute right-4 top-4 rounded-md p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700"
+ >
+ <X className="h-5 w-5" />
+ </button>
+
+ {/* Header */}
+ <h2 className="text-center text-xl font-semibold text-neutral-900 dark:text-white">
+ Add a new Computer
+ </h2>
+
+ {/* Form */}
+ <form onSubmit={handleSubmit} className="mt-6 flex flex-col gap-4">
+ <div>
+ <label
+ htmlFor="computer-name"
+ className="block text-sm font-medium text-neutral-700 dark:text-neutral-300"
+ >
+ Name
+ </label>
+ <input
+ id="computer-name"
+ type="text"
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ placeholder="My Computer"
+ className="mt-1 w-full rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-600 dark:bg-neutral-700"
+ disabled={isLoading}
+ />
+ </div>
+
+ <div>
+ <label
+ htmlFor="computer-url"
+ className="block text-sm font-medium text-neutral-700 dark:text-neutral-300"
+ >
+ URL
+ </label>
+ <input
+ id="computer-url"
+ type="text"
+ value={url}
+ onChange={(e) => setUrl(e.target.value)}
+ placeholder="http://localhost:8443"
+ className="mt-1 w-full rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-600 dark:bg-neutral-700"
+ disabled={isLoading}
+ />
+ </div>
+
+ {error && <p className="text-sm text-red-600 dark:text-red-400">{error}</p>}
+
+ <div className="mt-4 flex justify-end gap-3">
+ <button
+ type="button"
+ onClick={onClose}
+ disabled={isLoading}
+ className="rounded-md border px-4 py-2 hover:bg-neutral-50 disabled:opacity-50 dark:hover:bg-neutral-700"
+ >
+ Cancel
+ </button>
+ <button
+ type="submit"
+ disabled={isLoading}
+ className="rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:opacity-50"
+ >
+ {isLoading ? 'Adding...' : 'Add'}
+ </button>
+ </div>
+ </form>
+ </div>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/modals/ExportTrajectoryModal.tsx b/libs/typescript/playground/src/components/modals/ExportTrajectoryModal.tsx
new file mode 100644
index 0000000000..91dc64889f
--- /dev/null
+++ b/libs/typescript/playground/src/components/modals/ExportTrajectoryModal.tsx
@@ -0,0 +1,250 @@
+import { Download, ImageIcon, Loader2, MousePointerClick } from 'lucide-react';
+import { useCallback, useEffect, useState } from 'react';
+import { Modal } from '../ui/Modal';
+import { Button } from '../ui/button';
+import { usePlaygroundTelemetry } from '../../telemetry';
+
+interface RunSummary {
+ index: number;
+ userPromptPreview: string;
+ userPrompt: string;
+ screenshotCount: number;
+ actionCount: number;
+ isEmpty: boolean;
+ messageCount: number;
+}
+
+interface ExportTrajectoryModalProps {
+ isOpen: boolean;
+ onClose: () => void;
+ sessionId: number;
+}
+
+export default function ExportTrajectoryModal({
+ isOpen,
+ onClose,
+ sessionId,
+}: ExportTrajectoryModalProps) {
+ const [runs, setRuns] = useState<RunSummary[]>([]);
+ const [chatTitle, setChatTitle] = useState<string>('');
+ const [selectedIndices, setSelectedIndices] = useState<Set<number>>(new Set());
+ const [loading, setLoading] = useState(false);
+ const [exporting, setExporting] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+ const { trackTrajectoryExported } = usePlaygroundTelemetry();
+
+ // Fetch run information when modal opens
+ useEffect(() => {
+ if (!isOpen || !sessionId) return;
+
+ const fetchRuns = async () => {
+ setLoading(true);
+ setError(null);
+
+ try {
+ const response = await fetch(`/api/chat/${sessionId}/export`);
+ const data = await response.json();
+
+ if (!response.ok || !data.success) {
+ throw new Error(data.error || 'Failed to fetch trajectory runs');
+ }
+
+ setRuns(data.runs);
+ setChatTitle(data.chatTitle);
+ // Select all by default
+ setSelectedIndices(new Set(data.runs.map((r: RunSummary) => r.index)));
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'Failed to load runs');
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ fetchRuns();
+ }, [isOpen, sessionId]);
+
+ const toggleRun = useCallback((index: number) => {
+ setSelectedIndices((prev) => {
+ const next = new Set(prev);
+ if (next.has(index)) {
+ next.delete(index);
+ } else {
+ next.add(index);
+ }
+ return next;
+ });
+ }, []);
+
+ const selectAll = useCallback(() => {
+ setSelectedIndices(new Set(runs.map((r) => r.index)));
+ }, [runs]);
+
+ const deselectAll = useCallback(() => {
+ setSelectedIndices(new Set());
+ }, []);
+
+ const handleExport = async () => {
+ if (selectedIndices.size === 0) return;
+
+ setExporting(true);
+ setError(null);
+
+ try {
+ const response = await fetch(`/api/chat/${sessionId}/export`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({
+ runIndices: Array.from(selectedIndices).sort(),
+ }),
+ });
+
+ if (!response.ok) {
+ const data = await response.json().catch(() => ({}));
+ throw new Error(data.error || 'Export failed');
+ }
+
+ // Download the ZIP file
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download =
+ response.headers.get('Content-Disposition')?.split('filename="')[1]?.replace('"', '') ||
+ 'trajectory_export.zip';
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
+ URL.revokeObjectURL(url);
+
+ trackTrajectoryExported({ runCount: selectedIndices.size });
+ onClose();
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'Export failed');
+ } finally {
+ setExporting(false);
+ }
+ };
+
+ return (
+ <Modal isOpen={isOpen} onClose={onClose} contentClassName="max-w-lg">
+ <div className="flex flex-col">
+ {/* Header */}
+ <div className="mb-4">
+ <h2 className="font-bold text-neutral-900 text-xl dark:text-white">Export Trajectory</h2>
+ {chatTitle && (
+ <p className="mt-1 text-neutral-600 text-sm dark:text-neutral-400">{chatTitle}</p>
+ )}
+ </div>
+
+ {/* Content */}
+ {loading ? (
+ <div className="flex items-center justify-center py-8">
+ <Loader2 className="h-6 w-6 animate-spin text-neutral-500" />
+ <span className="ml-2 text-neutral-500">Loading runs...</span>
+ </div>
+ ) : error ? (
+ <div className="rounded-md bg-red-50 p-4 text-red-600 text-sm dark:bg-red-900/20 dark:text-red-400">
+ {error}
+ </div>
+ ) : runs.length === 0 ? (
+ <div className="py-8 text-center text-neutral-500">
+ No runs found in this chat session.
+ </div>
+ ) : (
+ <>
+ <p className="mb-3 text-neutral-600 text-sm dark:text-neutral-400">
+ Select runs to export:
+ </p>
+
+ {/* Run list */}
+ <div className="max-h-64 space-y-2 overflow-y-auto rounded-md border border-neutral-200 p-2 dark:border-neutral-700">
+ {runs.map((run) => (
+ <label
+ key={run.index}
+ className="flex cursor-pointer items-start gap-3 rounded-md p-2 transition-colors hover:bg-neutral-50 dark:hover:bg-neutral-700/50"
+ >
+ <input
+ type="checkbox"
+ checked={selectedIndices.has(run.index)}
+ onChange={() => toggleRun(run.index)}
+ className="mt-1 h-4 w-4 rounded border-neutral-300 text-blue-600 focus:ring-blue-500 dark:border-neutral-600"
+ />
+ <div className="min-w-0 flex-1">
+ <div className="flex items-center gap-2">
+ <span className="font-medium text-neutral-900 text-sm dark:text-white">
+ Run {run.index + 1}
+ </span>
+ {run.isEmpty && (
+ <span className="rounded bg-neutral-100 px-1.5 py-0.5 text-neutral-500 text-xs dark:bg-neutral-700 dark:text-neutral-400">
+ Empty
+ </span>
+ )}
+ </div>
+ <p className="mt-0.5 truncate text-neutral-600 text-sm dark:text-neutral-400">
+ {run.userPromptPreview || '[No prompt]'}
+ </p>
+ <div className="mt-1 flex items-center gap-3 text-neutral-500 text-xs dark:text-neutral-500">
+ <span className="flex items-center gap-1">
+ <MousePointerClick className="h-3 w-3" />
+ {run.actionCount} actions
+ </span>
+ <span className="flex items-center gap-1">
+ <ImageIcon className="h-3 w-3" />
+ {run.screenshotCount} screenshots
+ </span>
+ </div>
+ </div>
+ </label>
+ ))}
+ </div>
+
+ {/* Selection controls */}
+ <div className="mt-3 flex gap-2">
+ <button
+ type="button"
+ onClick={selectAll}
+ className="text-blue-600 text-sm hover:underline dark:text-blue-400"
+ >
+ Select All
+ </button>
+ <span className="text-neutral-300 dark:text-neutral-600">|</span>
+ <button
+ type="button"
+ onClick={deselectAll}
+ className="text-blue-600 text-sm hover:underline dark:text-blue-400"
+ >
+ Deselect All
+ </button>
+ <span className="ml-auto text-neutral-500 text-sm">
+ {selectedIndices.size} of {runs.length} selected
+ </span>
+ </div>
+ </>
+ )}
+
+ {/* Footer */}
+ <div className="mt-6 flex justify-end gap-3">
+ <Button variant="outline" onClick={onClose} disabled={exporting}>
+ Cancel
+ </Button>
+ <Button
+ onClick={handleExport}
+ disabled={loading || exporting || selectedIndices.size === 0}
+ >
+ {exporting ? (
+ <>
+ <Loader2 className="h-4 w-4 animate-spin" />
+ Exporting...
+ </>
+ ) : (
+ <>
+ <Download className="h-4 w-4" />
+ Export ZIP
+ </>
+ )}
+ </Button>
+ </div>
+ </div>
+ </Modal>
+ );
+}
diff --git a/libs/typescript/playground/src/components/modals/ReplayTrajectoryModal.tsx b/libs/typescript/playground/src/components/modals/ReplayTrajectoryModal.tsx
new file mode 100644
index 0000000000..ab22f7d8e2
--- /dev/null
+++ b/libs/typescript/playground/src/components/modals/ReplayTrajectoryModal.tsx
@@ -0,0 +1,290 @@
+import { Loader2, Play, X } from 'lucide-react';
+import { memo, useCallback, useEffect, useRef, useState } from 'react';
+import TrajectoryViewer from '../TrajectoryViewer';
+import { usePlaygroundTelemetry } from '../../telemetry';
+import { inferRuns } from '../../utils/trajectory';
+import type { AgentMessage } from '../../types';
+
+// Memoized wrapper to prevent TrajectoryViewer from re-rendering due to parent state changes
+// This is needed because TrajectoryViewer has a bug where its processZipUrl effect
+// re-runs when its dependencies change (which happens on every state update)
+const MemoizedTrajectoryViewer = memo(TrajectoryViewer);
+
+interface ReplayTrajectoryModalProps {
+ isOpen: boolean;
+ onClose: () => void;
+ sessionId: number;
+ chatTitle?: string;
+ /** Optional: directly pass messages to avoid refetching */
+ messages?: AgentMessage[];
+ /** Optional: model ID for display */
+ modelId?: string;
+}
+
+interface RunSummary {
+ index: number;
+ userPromptPreview: string;
+ screenshotCount: number;
+ actionCount: number;
+ isEmpty: boolean;
+ messageCount: number;
+}
+
+export default function ReplayTrajectoryModal({
+ isOpen,
+ onClose,
+ sessionId,
+ chatTitle,
+ messages: propMessages,
+ modelId,
+}: ReplayTrajectoryModalProps) {
+ const [runs, setRuns] = useState<RunSummary[]>([]);
+ const [selectedRunIndex, setSelectedRunIndex] = useState<number | null>(null);
+ const [loading, setLoading] = useState(true);
+ const [zipUrl, setZipUrl] = useState<string | null>(null);
+ const [generatingZip, setGeneratingZip] = useState(false);
+ const [title, setTitle] = useState(chatTitle || 'Chat Replay');
+ const { trackTrajectoryReplayed } = usePlaygroundTelemetry();
+
+ // Track if we've already initialized to prevent re-runs
+ const hasInitializedRef = useRef(false);
+ // Track the current zipUrl for the selected run to prevent re-generation
+ const loadedRunIndexRef = useRef<number | null>(null);
+
+ // Fetch run information - only run once when modal opens
+ useEffect(() => {
+ if (!isOpen || hasInitializedRef.current) return;
+
+ const fetchRuns = async () => {
+ setLoading(true);
+ hasInitializedRef.current = true;
+
+ try {
+ // If messages are passed directly, infer runs locally
+ if (propMessages && propMessages.length > 0) {
+ const inferredRuns = inferRuns(propMessages);
+ setRuns(
+ inferredRuns.map((run) => ({
+ index: run.index,
+ userPromptPreview: run.userPromptPreview,
+ screenshotCount: run.screenshotCount,
+ actionCount: run.actionCount,
+ isEmpty: run.isEmpty,
+ messageCount: run.messages.length,
+ }))
+ );
+ // Auto-select first run with content
+ const firstNonEmpty = inferredRuns.find((r) => !r.isEmpty);
+ if (firstNonEmpty) {
+ setSelectedRunIndex(firstNonEmpty.index);
+ } else if (inferredRuns.length > 0) {
+ setSelectedRunIndex(inferredRuns[0].index);
+ }
+ } else {
+ // Fetch from API
+ const response = await fetch(`/api/chat/${sessionId}/export`);
+ if (!response.ok) {
+ throw new Error('Failed to fetch run information');
+ }
+
+ const data = await response.json();
+ setRuns(data.runs || []);
+ setTitle(data.chatTitle || 'Chat Replay');
+
+ // Auto-select first run with content
+ const firstNonEmpty = data.runs?.find(
+ (r: RunSummary) => !r.isEmpty && r.screenshotCount > 0
+ );
+ if (firstNonEmpty) {
+ setSelectedRunIndex(firstNonEmpty.index);
+ } else if (data.runs?.length > 0) {
+ setSelectedRunIndex(data.runs[0].index);
+ }
+ }
+ } catch (error) {
+ console.error('Failed to fetch runs:', error);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ fetchRuns();
+ }, [isOpen, sessionId, propMessages]);
+
+ // Reset initialization when modal closes
+ useEffect(() => {
+ if (!isOpen) {
+ hasInitializedRef.current = false;
+ loadedRunIndexRef.current = null;
+ }
+ }, [isOpen]);
+
+ // Generate ZIP for the selected run
+ const generateZipForRun = useCallback(
+ async (runIndex: number) => {
+ // Prevent re-generating if already loaded for this run
+ if (loadedRunIndexRef.current === runIndex) return;
+
+ setGeneratingZip(true);
+ setZipUrl(null);
+
+ try {
+ const response = await fetch(`/api/chat/${sessionId}/export`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ runIndices: [runIndex] }),
+ });
+
+ if (!response.ok) {
+ throw new Error('Failed to generate trajectory');
+ }
+
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ loadedRunIndexRef.current = runIndex;
+ setZipUrl(url);
+ trackTrajectoryReplayed({ runIndex });
+ } catch (error) {
+ console.error('Failed to generate ZIP:', error);
+ } finally {
+ setGeneratingZip(false);
+ }
+ },
+ [sessionId, trackTrajectoryReplayed]
+ );
+
+ // Load trajectory when run is selected
+ useEffect(() => {
+ if (selectedRunIndex !== null && !loading && loadedRunIndexRef.current !== selectedRunIndex) {
+ generateZipForRun(selectedRunIndex);
+ }
+ }, [selectedRunIndex, loading, generateZipForRun]);
+
+ // Cleanup ZIP URL when it changes and on unmount
+ useEffect(() => {
+ return () => {
+ if (zipUrl) {
+ URL.revokeObjectURL(zipUrl);
+ }
+ };
+ }, [zipUrl]);
+
+ if (!isOpen) return null;
+
+ const selectedRun = runs.find((r) => r.index === selectedRunIndex);
+
+ return (
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
+ <div className="relative flex h-[90vh] w-[95vw] max-w-7xl flex-col overflow-hidden rounded-lg bg-white shadow-xl dark:bg-neutral-900">
+ {/* Header */}
+ <div className="flex items-center justify-between border-neutral-200 border-b px-4 py-3 dark:border-neutral-700">
+ <div className="flex items-center gap-3">
+ <Play className="h-5 w-5 text-neutral-600 dark:text-neutral-400" />
+ <h2 className="font-semibold text-lg text-neutral-900 dark:text-white">
+ Replay: {title}
+ </h2>
+ </div>
+ <button
+ type="button"
+ onClick={onClose}
+ className="rounded-full p-1.5 text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-200"
+ >
+ <X className="h-5 w-5" />
+ </button>
+ </div>
+
+ {/* Run selector tabs */}
+ {runs.length > 1 && (
+ <div className="flex gap-1 overflow-x-auto border-neutral-200 border-b bg-neutral-50 px-4 py-2 dark:border-neutral-700 dark:bg-neutral-800/50">
+ {runs.map((run) => (
+ <button
+ key={run.index}
+ type="button"
+ onClick={() => setSelectedRunIndex(run.index)}
+ disabled={generatingZip}
+ className={`flex-shrink-0 rounded-md px-3 py-1.5 text-sm transition-colors ${
+ selectedRunIndex === run.index
+ ? 'bg-blue-500 text-white'
+ : 'bg-white text-neutral-700 hover:bg-neutral-100 dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-600'
+ } ${run.isEmpty || run.screenshotCount === 0 ? 'opacity-50' : ''}`}
+ title={run.userPromptPreview}
+ >
+ <span className="max-w-[150px] truncate">
+ Run {run.index + 1}: {run.userPromptPreview || 'Empty'}
+ </span>
+ </button>
+ ))}
+ </div>
+ )}
+
+ {/* Main content */}
+ <div className="flex-1 overflow-hidden">
+ {loading ? (
+ <div className="flex h-full items-center justify-center">
+ <div className="flex flex-col items-center gap-3">
+ <Loader2 className="h-8 w-8 animate-spin text-blue-500" />
+ <p className="text-neutral-600 text-sm dark:text-neutral-400">
+ Loading trajectory data...
+ </p>
+ </div>
+ </div>
+ ) : runs.length === 0 ? (
+ <div className="flex h-full items-center justify-center">
+ <p className="text-neutral-500 dark:text-neutral-400">
+ No trajectory runs found in this chat.
+ </p>
+ </div>
+ ) : generatingZip ? (
+ <div className="flex h-full items-center justify-center">
+ <div className="flex flex-col items-center gap-3">
+ <Loader2 className="h-8 w-8 animate-spin text-blue-500" />
+ <p className="text-neutral-600 text-sm dark:text-neutral-400">
+ Preparing trajectory for replay...
+ </p>
+ </div>
+ </div>
+ ) : selectedRun && selectedRun.screenshotCount === 0 ? (
+ <div className="flex h-full items-center justify-center">
+ <div className="text-center">
+ <p className="text-neutral-500 dark:text-neutral-400">
+ This run has no screenshots to replay.
+ </p>
+ <p className="mt-1 text-neutral-400 text-sm dark:text-neutral-500">
+ {selectedRun.actionCount} action
+ {selectedRun.actionCount !== 1 ? 's' : ''} recorded
+ </p>
+ </div>
+ </div>
+ ) : zipUrl ? (
+ <MemoizedTrajectoryViewer
+ key={zipUrl}
+ zipUrl={zipUrl}
+ showToolbar={true}
+ scroll={true}
+ scenarioName={selectedRun?.userPromptPreview || 'Replay'}
+ operatingSystem="linux"
+ autoLoop={false}
+ userPrompt={selectedRun?.userPromptPreview}
+ modelOverride={modelId}
+ />
+ ) : null}
+ </div>
+
+ {/* Footer with run info */}
+ {selectedRun && !loading && (
+ <div className="flex items-center justify-between border-neutral-200 border-t bg-neutral-50 px-4 py-2 text-xs dark:border-neutral-700 dark:bg-neutral-800/50">
+ <span className="text-neutral-500 dark:text-neutral-400">
+ {selectedRun.screenshotCount} screenshot
+ {selectedRun.screenshotCount !== 1 ? 's' : ''} &middot; {selectedRun.actionCount}{' '}
+ action
+ {selectedRun.actionCount !== 1 ? 's' : ''}
+ </span>
+ <span className="text-neutral-400 dark:text-neutral-500">
+ Run {(selectedRun.index || 0) + 1} of {runs.length}
+ </span>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/modals/SettingsModal.tsx b/libs/typescript/playground/src/components/modals/SettingsModal.tsx
new file mode 100644
index 0000000000..6005b24ddf
--- /dev/null
+++ b/libs/typescript/playground/src/components/modals/SettingsModal.tsx
@@ -0,0 +1,56 @@
+// Settings modal component
+// Adapted from cloud/src/website/app/components/playground/modals/SettingsModal.tsx
+
+import { X } from 'lucide-react';
+import { cn } from '../../utils/cn';
+
+interface SettingsModalProps {
+ /** Whether the modal is open */
+ isOpen: boolean;
+ /** Callback to close the modal */
+ onClose: () => void;
+ /** Optional class name for the modal content */
+ className?: string;
+ /** Optional children to render in the modal */
+ children?: React.ReactNode;
+}
+
+export function SettingsModal({ isOpen, onClose, className, children }: SettingsModalProps) {
+ if (!isOpen) return null;
+
+ return (
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50">
+ <div
+ className={cn(
+ 'relative w-full max-w-3xl rounded-lg bg-white p-6 shadow-xl dark:bg-neutral-800',
+ className
+ )}
+ >
+ {/* Close button */}
+ <button
+ type="button"
+ onClick={onClose}
+ className="absolute right-4 top-4 rounded-md p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700"
+ >
+ <X className="h-5 w-5" />
+ </button>
+
+ {/* Content */}
+ {children || (
+ <div className="flex flex-col">
+ <div className="mb-4">
+ <h2 className="text-xl font-bold text-neutral-900 dark:text-white">
+ Playground Settings
+ </h2>
+ <p className="mt-2 text-sm text-neutral-600 dark:text-neutral-400">
+ Configure your playground settings here.
+ </p>
+ </div>
+
+ <div className="py-8 text-center text-neutral-500">Settings panel coming soon...</div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/modals/index.ts b/libs/typescript/playground/src/components/modals/index.ts
new file mode 100644
index 0000000000..ee1bc1db17
--- /dev/null
+++ b/libs/typescript/playground/src/components/modals/index.ts
@@ -0,0 +1,5 @@
+// Barrel export for modals
+export { SettingsModal } from './SettingsModal';
+export { CustomComputerModal } from './CustomComputerModal';
+export { default as ExportTrajectoryModal } from './ExportTrajectoryModal';
+export { default as ReplayTrajectoryModal } from './ReplayTrajectoryModal';
diff --git a/libs/typescript/playground/src/components/primitives/ChatInput.tsx b/libs/typescript/playground/src/components/primitives/ChatInput.tsx
new file mode 100644
index 0000000000..75a27911e6
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/ChatInput.tsx
@@ -0,0 +1,565 @@
+// Chat input component
+// Based on cloud/src/website/app/components/playground/ChatInput.tsx from main
+
+import { Loader2, Monitor, Send, StopCircle } from 'lucide-react';
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import {
+ Select,
+ SelectContent,
+ SelectGroup,
+ SelectItem,
+ SelectLabel,
+ SelectTrigger,
+ SelectValue,
+} from '../ui/select';
+import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip';
+import type { Computer, Model, ModelProvider, VM } from '../../types';
+import { isVM, getComputerId, getComputerName } from '../../types';
+
+/**
+ * Groups computers by workspace name, sorted alphabetically with "Custom" at the end.
+ */
+function groupComputersByWorkspace(
+ computers: Computer[]
+): Array<{ workspaceName: string; computers: Computer[] }> {
+ const groups = new Map<string, Computer[]>();
+
+ for (const computer of computers) {
+ const wsName = isVM(computer) ? 'Sandboxes' : 'Custom';
+ if (!groups.has(wsName)) {
+ groups.set(wsName, []);
+ }
+ groups.get(wsName)!.push(computer);
+ }
+
+ // Sort alphabetically, with "Custom" at the end
+ return Array.from(groups.entries())
+ .sort(([a], [b]) => {
+ if (a === 'Custom') return 1;
+ if (b === 'Custom') return -1;
+ return a.localeCompare(b);
+ })
+ .map(([workspaceName, computers]) => ({ workspaceName, computers }));
+}
+
+const GHOST_PROMPTS = [
+ 'Describe my screen',
+ 'Type ls in terminal',
+ 'Go to google.com',
+ 'Make a new folder',
+ 'Delete my newest download',
+];
+
+function useGhostTyping(isActive: boolean) {
+ const [ghostText, setGhostText] = useState('');
+ const [promptIndex, setPromptIndex] = useState(0);
+ const [charIndex, setCharIndex] = useState(0);
+ const [isDeleting, setIsDeleting] = useState(false);
+ const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
+
+ const clearTimeoutRef = useCallback(() => {
+ if (timeoutRef.current) {
+ clearTimeout(timeoutRef.current);
+ timeoutRef.current = null;
+ }
+ }, []);
+
+ useEffect(() => {
+ if (!isActive) {
+ clearTimeoutRef();
+ setGhostText('');
+ return;
+ }
+
+ const currentPrompt = GHOST_PROMPTS[promptIndex];
+
+ if (!isDeleting) {
+ // Typing
+ if (charIndex < currentPrompt.length) {
+ timeoutRef.current = setTimeout(() => {
+ setGhostText(currentPrompt.slice(0, charIndex + 1));
+ setCharIndex((prev) => prev + 1);
+ }, 50);
+ } else {
+ // Pause at end before deleting
+ timeoutRef.current = setTimeout(() => {
+ setIsDeleting(true);
+ }, 2000);
+ }
+ } else {
+ // Deleting
+ if (charIndex > 0) {
+ timeoutRef.current = setTimeout(() => {
+ setGhostText(currentPrompt.slice(0, charIndex - 1));
+ setCharIndex((prev) => prev - 1);
+ }, 30);
+ } else {
+ // Move to next prompt
+ setIsDeleting(false);
+ setPromptIndex((prev) => (prev + 1) % GHOST_PROMPTS.length);
+ }
+ }
+
+ return clearTimeoutRef;
+ }, [isActive, promptIndex, charIndex, isDeleting, clearTimeoutRef]);
+
+ return ghostText;
+}
+
+interface ChatInputProps {
+ // Core props
+ currentInput: string;
+ onInputChange: (value: string) => void;
+ onSendMessage: () => void;
+ onStopResponse: () => void;
+ isGenerating: boolean;
+
+ // Computer selection
+ computers: Computer[];
+ selectedComputer?: Computer;
+ onComputerChange: (computerId: string) => void;
+
+ // Model selection
+ availableModels: ModelProvider[];
+ selectedModel?: Model;
+ onModelChange: (modelId: string) => void;
+
+ // Optional props
+ hasMessages?: boolean;
+ isMobile?: boolean;
+ customModelId?: string;
+ customVncUrl?: string;
+ vmVersionInfo?: Map<string, { unreachable?: boolean; isOutdated?: boolean }>;
+
+ // Navigation props (optional - for cloud usage)
+ hasOrg?: boolean;
+ hasWorkspace?: boolean;
+ hasCredits?: boolean;
+ orgSlug?: string;
+ renderLink?: (props: {
+ to: string;
+ children: React.ReactNode;
+ className?: string;
+ }) => React.ReactNode;
+}
+
+export function ChatInput({
+ currentInput,
+ onInputChange,
+ onSendMessage,
+ onStopResponse,
+ isGenerating,
+ computers,
+ selectedComputer,
+ onComputerChange,
+ availableModels,
+ selectedModel,
+ onModelChange,
+ hasMessages = false,
+ isMobile = false,
+ customModelId,
+ customVncUrl,
+ vmVersionInfo = new Map(),
+ hasOrg = true,
+ hasWorkspace = true,
+ hasCredits = true,
+ renderLink,
+}: ChatInputProps) {
+ // Lock model/computer selection after first message, but only if they're set
+ // This allows users to still pick if the saved model/computer is unavailable
+ const isModelLocked = hasMessages && !!selectedModel;
+ const isComputerLocked = hasMessages && !!selectedComputer;
+
+ const handleModelChange = (modelId: string) => {
+ onModelChange(modelId);
+ };
+
+ const handleComputerChange = (computerId: string) => {
+ onComputerChange(computerId);
+ };
+
+ const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
+ onInputChange(e.target.value);
+ // Auto-resize textarea
+ e.target.style.height = 'auto';
+ e.target.style.height = `${e.target.scrollHeight}px`;
+ };
+
+ const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
+ if (e.key === 'Enter' && !e.shiftKey) {
+ e.preventDefault();
+ onSendMessage();
+ }
+ };
+
+ const handleOpenVnc = () => {
+ if (selectedComputer && isVM(selectedComputer)) {
+ const vm = selectedComputer as VM;
+ const vncUrl = customVncUrl || vm.vncUrl;
+ if (vncUrl) {
+ window.open(vncUrl, '_blank');
+ }
+ }
+ };
+
+ const sendDisabled =
+ !currentInput.trim() ||
+ (selectedComputer && isVM(selectedComputer) && (selectedComputer as VM).status !== 'running');
+
+ // Group computers by workspace
+ const groupedComputers = useMemo(() => groupComputersByWorkspace(computers), [computers]);
+
+ // Ghost typing - only show when input is empty and no messages
+ const showGhostTyping = !currentInput && !hasMessages && !isGenerating;
+ const ghostText = useGhostTyping(showGhostTyping);
+
+ // Desktop layout
+ if (!isMobile) {
+ return (
+ <div className="flex flex-col rounded-2xl bg-neutral-100 p-2 dark:bg-neutral-800">
+ {/* Textarea row */}
+ <div className="relative">
+ <textarea
+ value={currentInput}
+ onChange={handleInputChange}
+ onKeyDown={handleKeyDown}
+ placeholder={showGhostTyping ? '' : 'Send a message'}
+ disabled={isGenerating}
+ rows={1}
+ className="w-full resize-none rounded-2xl bg-neutral-100 px-3 pt-2 text-neutral-900 placeholder-neutral-400 focus:outline-none disabled:opacity-50 dark:bg-neutral-800 dark:text-white dark:placeholder-neutral-500"
+ style={{ minHeight: '44px', maxHeight: '200px' }}
+ />
+ {showGhostTyping && ghostText && (
+ <div
+ className="pointer-events-none absolute top-0 left-0 px-3 pt-2 text-neutral-400 dark:text-neutral-500"
+ aria-hidden="true"
+ >
+ {ghostText}
+ <span className="animate-pulse">|</span>
+ </div>
+ )}
+ </div>
+
+ {/* Desktop: Model & Sandbox selectors - button bar row */}
+ <div className="flex flex-wrap items-center justify-end gap-2">
+ {/* Computer selector - locked after first message */}
+ <Select
+ value={
+ selectedComputer &&
+ computers.find((c: Computer) => c.name === selectedComputer.name) !== undefined
+ ? getComputerId(selectedComputer)
+ : ''
+ }
+ onValueChange={handleComputerChange}
+ disabled={isComputerLocked}
+ >
+ <SelectTrigger
+ minimal
+ className="border-0 bg-neutral-100 text-neutral-400 hover:bg-white/60 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-neutral-800 dark:text-neutral-400 dark:hover:bg-neutral-700/60 [&>svg]:rotate-180"
+ >
+ <SelectValue placeholder="Sandbox" />
+ </SelectTrigger>
+ <SelectContent className="rounded-lg bg-white dark:bg-card">
+ {computers.length === 0 ? (
+ <div className="p-2 text-center">
+ <p className="mb-2 text-muted-foreground text-xs">
+ {!hasOrg
+ ? 'Set up an organization first'
+ : !hasWorkspace
+ ? 'Create a workspace first'
+ : 'No sandboxes available'}
+ </p>
+ </div>
+ ) : (
+ <>
+ {groupedComputers.map((group) => (
+ <SelectGroup key={group.workspaceName}>
+ <SelectLabel>{group.workspaceName}</SelectLabel>
+ {group.computers.map((c) => {
+ const isRunning = isVM(c) && (c as VM).status === 'running';
+ const versionInfo = isVM(c) ? vmVersionInfo.get((c as VM).vmId) : undefined;
+ const isUnreachable = versionInfo?.unreachable;
+ const vmComputer = c as VM;
+ return (
+ <SelectItem
+ key={getComputerId(c)}
+ value={getComputerId(c)}
+ className="hover:bg-neutral-200 dark:hover:bg-neutral-700"
+ >
+ <div className="flex items-center gap-2">
+ {isVM(c) &&
+ (vmComputer.status === 'restarting' ||
+ vmComputer.status === 'starting') ? (
+ <Loader2 className="h-3 w-3 animate-spin text-neutral-500 dark:text-neutral-400" />
+ ) : (
+ <div
+ className={`h-2 w-2 rounded-full ${
+ isUnreachable
+ ? 'bg-orange-500'
+ : isRunning
+ ? 'bg-green-500'
+ : 'bg-red-500'
+ }`}
+ />
+ )}
+ <span>{getComputerName(c)}</span>
+ {isVM(c) && vmComputer.status === 'starting' ? (
+ <span className="text-neutral-500 text-xs dark:text-neutral-400">
+ Starting
+ </span>
+ ) : isVM(c) && vmComputer.status === 'restarting' ? (
+ <span className="text-neutral-500 text-xs dark:text-neutral-400">
+ Restarting
+ </span>
+ ) : isUnreachable ? (
+ <span className="text-orange-600 text-xs dark:text-orange-400">
+ Not responding
+ </span>
+ ) : (
+ versionInfo?.isOutdated && (
+ <span className="text-orange-600 text-xs dark:text-orange-400">
+ Outdated
+ </span>
+ )
+ )}
+ </div>
+ </SelectItem>
+ );
+ })}
+ </SelectGroup>
+ ))}
+ </>
+ )}
+ </SelectContent>
+ </Select>
+
+ {/* Model selector - locked after first message */}
+ <Select
+ value={selectedModel?.id || ''}
+ onValueChange={handleModelChange}
+ disabled={!!customModelId || isModelLocked}
+ >
+ <SelectTrigger
+ minimal
+ className="border-0 bg-neutral-100 text-neutral-400 hover:bg-white/60 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-neutral-800 dark:text-neutral-400 dark:hover:bg-neutral-700/60 [&>svg]:rotate-180"
+ >
+ <SelectValue placeholder="Model" />
+ </SelectTrigger>
+ <SelectContent className="rounded-lg bg-white dark:bg-card">
+ {customModelId && (
+ <SelectGroup>
+ <SelectLabel>Custom</SelectLabel>
+ <SelectItem
+ key={customModelId}
+ value={customModelId}
+ className="hover:bg-neutral-200 dark:hover:bg-neutral-700"
+ >
+ {customModelId}
+ </SelectItem>
+ </SelectGroup>
+ )}
+ {availableModels.map((provider) => (
+ <SelectGroup key={provider.name}>
+ <SelectLabel>
+ {provider.name.charAt(0).toUpperCase() + provider.name.slice(1)}
+ </SelectLabel>
+ {provider.models.map((m) => (
+ <SelectItem
+ key={m.id}
+ value={m.id}
+ className="hover:bg-neutral-200 dark:hover:bg-neutral-700"
+ >
+ <span className="flex items-center gap-2">
+ {m.name}
+ {provider.name.toLowerCase() !== 'anthropic' && (
+ <span className="rounded bg-amber-100 px-1.5 py-0.5 font-medium text-amber-700 text-xs dark:bg-amber-900/30 dark:text-amber-400">
+ Preview
+ </span>
+ )}
+ </span>
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ ))}
+ </SelectContent>
+ </Select>
+
+ {/* Open VM button */}
+ {selectedComputer &&
+ isVM(selectedComputer) &&
+ ((selectedComputer as VM).vncUrl || customVncUrl) && (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ type="button"
+ onClick={handleOpenVnc}
+ className="flex h-8 w-8 items-center justify-center text-neutral-600 transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-white"
+ >
+ <Monitor className="h-4 w-4" />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Open VNC in new tab</p>
+ </TooltipContent>
+ </Tooltip>
+ )}
+
+ {/* Send/Stop button */}
+ {isGenerating ? (
+ <button
+ type="button"
+ onClick={onStopResponse}
+ className="flex h-8 w-8 items-center justify-center text-neutral-600 transition-colors hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-white"
+ >
+ <StopCircle className="h-4 w-4" />
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={onSendMessage}
+ disabled={sendDisabled}
+ className="flex h-8 w-8 items-center justify-center text-neutral-600 transition-colors hover:text-neutral-900 disabled:text-neutral-300 dark:text-neutral-400 dark:disabled:text-neutral-600 dark:hover:text-white"
+ title={
+ selectedComputer &&
+ isVM(selectedComputer) &&
+ (selectedComputer as VM).status !== 'running'
+ ? 'Sandbox is not running'
+ : undefined
+ }
+ >
+ <Send className="h-4 w-4" />
+ </button>
+ )}
+ </div>
+ </div>
+ );
+ }
+
+ // Mobile layout
+ return (
+ <div className="space-y-2">
+ {/* Mobile selectors row - locked after first message */}
+ <div className="flex gap-2">
+ <Select
+ value={
+ selectedComputer &&
+ computers.find((c: Computer) => c.name === selectedComputer.name) !== undefined
+ ? getComputerId(selectedComputer)
+ : ''
+ }
+ onValueChange={handleComputerChange}
+ disabled={isComputerLocked}
+ >
+ <SelectTrigger
+ minimal
+ className="flex-1 border-0 bg-neutral-100 text-neutral-600 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-neutral-800 dark:text-neutral-400"
+ >
+ <SelectValue placeholder="Sandbox" />
+ </SelectTrigger>
+ <SelectContent className="z-[100] rounded-lg bg-white dark:bg-card">
+ {groupedComputers.map((group) => (
+ <SelectGroup key={group.workspaceName}>
+ <SelectLabel>{group.workspaceName}</SelectLabel>
+ {group.computers.map((c: Computer) => (
+ <SelectItem
+ key={getComputerId(c)}
+ value={getComputerId(c)}
+ className="hover:bg-neutral-200 dark:hover:bg-neutral-700"
+ >
+ {getComputerName(c)}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ ))}
+ </SelectContent>
+ </Select>
+
+ <Select
+ value={selectedModel?.id || ''}
+ onValueChange={handleModelChange}
+ disabled={!!customModelId || isModelLocked}
+ >
+ <SelectTrigger
+ minimal
+ className="flex-1 border-0 bg-neutral-100 text-neutral-600 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-neutral-800 dark:text-neutral-400"
+ >
+ <SelectValue placeholder="Model" />
+ </SelectTrigger>
+ <SelectContent className="z-[100] rounded-lg bg-white dark:bg-card">
+ {customModelId && (
+ <SelectGroup>
+ <SelectLabel>Custom</SelectLabel>
+ <SelectItem
+ key={customModelId}
+ value={customModelId}
+ className="hover:bg-neutral-200 dark:hover:bg-neutral-700"
+ >
+ {customModelId}
+ </SelectItem>
+ </SelectGroup>
+ )}
+ {availableModels.map((provider) => (
+ <SelectGroup key={provider.name}>
+ <SelectLabel>
+ {provider.name.charAt(0).toUpperCase() + provider.name.slice(1)}
+ </SelectLabel>
+ {provider.models.map((m) => (
+ <SelectItem
+ key={m.id}
+ value={m.id}
+ className="hover:bg-neutral-200 dark:hover:bg-neutral-700"
+ >
+ {m.name}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+
+ {/* Mobile input row */}
+ <div className="flex items-end gap-2 rounded-2xl bg-neutral-100 p-2 dark:bg-neutral-800">
+ <div className="relative flex-1">
+ <textarea
+ value={currentInput}
+ onChange={handleInputChange}
+ onKeyDown={handleKeyDown}
+ placeholder={showGhostTyping ? '' : 'Send a message'}
+ disabled={isGenerating}
+ rows={1}
+ className="w-full resize-none bg-transparent px-2 pt-1 text-neutral-900 placeholder-neutral-400 focus:outline-none disabled:opacity-50 dark:text-white dark:placeholder-neutral-500"
+ style={{ minHeight: '36px', maxHeight: '120px' }}
+ />
+ {showGhostTyping && ghostText && (
+ <div
+ className="pointer-events-none absolute top-0 left-0 px-2 pt-1 text-neutral-400 dark:text-neutral-500"
+ aria-hidden="true"
+ >
+ {ghostText}
+ <span className="animate-pulse">|</span>
+ </div>
+ )}
+ </div>
+ {isGenerating ? (
+ <button
+ type="button"
+ onClick={onStopResponse}
+ className="flex h-8 w-8 shrink-0 items-center justify-center text-neutral-600 dark:text-neutral-400"
+ >
+ <StopCircle className="h-4 w-4" />
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={onSendMessage}
+ disabled={sendDisabled}
+ className="flex h-8 w-8 shrink-0 items-center justify-center text-neutral-600 disabled:text-neutral-300 dark:text-neutral-400 dark:disabled:text-neutral-600"
+ >
+ <Send className="h-4 w-4" />
+ </button>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/primitives/ChatMessage.tsx b/libs/typescript/playground/src/components/primitives/ChatMessage.tsx
new file mode 100644
index 0000000000..c0dc2f7fff
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/ChatMessage.tsx
@@ -0,0 +1,766 @@
+import { AnimatePresence, motion } from 'motion/react';
+import {
+ ArrowDown,
+ ArrowUp,
+ Brain,
+ Camera,
+ Check,
+ CheckCircle,
+ ChevronDown,
+ ChevronRight,
+ Clock,
+ Copy,
+ Keyboard,
+ Mouse,
+ MousePointer,
+ Move,
+ RotateCcw,
+ Wrench,
+ XCircle,
+} from 'lucide-react';
+import React, { useState } from 'react';
+import Markdown from 'react-markdown';
+import remarkGfm from 'remark-gfm';
+import { ThinkingCompleteAnimation } from './ThinkingCompleteAnimation';
+import { cn } from '../../utils/cn';
+import type {
+ AgentMessage,
+ AssistantMessage,
+ ComputerAction,
+ ComputerCallMessage,
+ ComputerCallOutputMessage,
+ FunctionCallMessage,
+ FunctionCallOutputMessage,
+ InputContent,
+ OutputContent,
+ ReasoningMessage,
+ UserMessage,
+} from '../../types';
+
+interface MessageChatProps {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ toolCalls?: {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ output?: AgentMessage;
+ }[];
+ isLastInGroup?: boolean; // New prop to indicate if this is the last consecutive agent message
+ isLastConsecutiveUserMessage?: boolean; // Whether this is the last user message in a consecutive group
+ durationSeconds?: number; // Duration of the request in seconds (in-memory only)
+}
+
+export const ChatMessage: React.FC<MessageChatProps> = React.memo(
+ ({
+ message,
+ screenshot,
+ toolCalls,
+ isLastInGroup,
+ isLastConsecutiveUserMessage,
+ durationSeconds,
+ }) => {
+ const [isReasoningExpanded, setIsReasoningExpanded] = useState<boolean>(false);
+
+ const renderContent = (content: string | InputContent[] | OutputContent[]): string => {
+ if (typeof content === 'string') {
+ return content;
+ }
+
+ return content
+ .map((item) => {
+ if ('text' in item && item.text) {
+ return item.text;
+ }
+ if (item.type === 'input_image') {
+ //todo: image input
+ return '[Image]';
+ }
+ return '';
+ })
+ .filter(Boolean)
+ .join(' ');
+ };
+
+ const UserMessageComponent = ({
+ message,
+ index,
+ showCopyButton,
+ }: {
+ message: UserMessage;
+ index: string;
+ showCopyButton?: boolean;
+ }) => {
+ const [copied, setCopied] = useState(false);
+
+ const handleCopy = () => {
+ navigator.clipboard.writeText(renderContent(message.content));
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ };
+
+ return (
+ <div key={index} className="group flex flex-col items-end gap-2">
+ <div className="max-w-2xl rounded-3xl bg-neutral-100 px-5 py-3 text-left dark:bg-neutral-800">
+ <p className="text-neutral-900 dark:text-white">{renderContent(message.content)}</p>
+ </div>
+ {/* Copy button - only visible on hover and only on last consecutive user message */}
+ {showCopyButton && (
+ <button
+ type="button"
+ onClick={handleCopy}
+ className="rounded-lg p-1.5 opacity-0 transition-all hover:bg-neutral-100 group-hover:opacity-100 dark:hover:bg-neutral-800"
+ title="Copy message"
+ >
+ {copied ? (
+ <Check className="h-4 w-4 text-green-600 dark:text-green-400" />
+ ) : (
+ <Copy className="h-4 w-4 text-neutral-500 dark:text-neutral-400" />
+ )}
+ </button>
+ )}
+ </div>
+ );
+ };
+
+ const renderUserMessage = (message: UserMessage, index: string) => {
+ return (
+ <UserMessageComponent
+ message={message}
+ index={index}
+ showCopyButton={isLastConsecutiveUserMessage}
+ />
+ );
+ };
+
+ const BaseAssistantMessage = ({
+ children,
+ index,
+ className,
+ }: {
+ children: React.ReactNode;
+ index: string;
+ className?: string;
+ }) => {
+ return (
+ <div key={index} className="flex justify-start">
+ <div
+ className={cn(
+ 'flex max-w-4xl gap-2 rounded-xl border border-neutral-200 bg-white px-3 py-2 text-left shadow-sm dark:border-neutral-700 dark:bg-neutral-900',
+ className
+ )}
+ >
+ {children}
+ </div>
+ </div>
+ );
+ };
+
+ const AssistantMessageComponent = ({
+ message,
+ index,
+ toolCalls: messageToolCalls,
+ isLastInGroup,
+ durationSeconds: msgDurationSeconds,
+ }: {
+ message: AssistantMessage;
+ index: string;
+ toolCalls?: {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ output?: AgentMessage;
+ }[];
+ isLastInGroup?: boolean;
+ durationSeconds?: number;
+ }) => {
+ const [copied, setCopied] = useState(false);
+
+ const [expandedCallIndex, setExpandedCallIndex] = useState<number | null>(null);
+
+ const handleCopy = () => {
+ // Copy all consecutive agent messages
+ let textToCopy = renderContent(message.content);
+
+ // If there are tool calls, include them in the copy
+ if (messageToolCalls && messageToolCalls.length > 0) {
+ const toolCallsText = messageToolCalls
+ .map(({ message: toolMessage }) => {
+ if (toolMessage.type === 'computer_call') {
+ const action = (toolMessage as ComputerCallMessage).action;
+ return `[Action: ${action.type}]`;
+ }
+ if (toolMessage.type === 'reasoning') {
+ const reasoning = toolMessage as ReasoningMessage;
+ return `[Reasoning: ${reasoning.summary.map((s) => s.text).join(' ')}]`;
+ }
+ return '';
+ })
+ .filter(Boolean)
+ .join('\n');
+
+ if (toolCallsText) {
+ textToCopy += `\n\n${toolCallsText}`;
+ }
+ }
+
+ navigator.clipboard.writeText(textToCopy);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ };
+
+ const toggleCallExpanded = (index: number) => {
+ // Only allow one expanded at a time
+ setExpandedCallIndex(expandedCallIndex === index ? null : index);
+ };
+
+ const getCallIcon = (toolMessage: AgentMessage) => {
+ if (toolMessage.type === 'computer_call') {
+ const action = (toolMessage as ComputerCallMessage).action;
+ switch (action.type) {
+ case 'click':
+ return <Mouse className="h-4 w-4" />;
+ case 'type':
+ return <Keyboard className="h-4 w-4" />;
+ case 'screenshot':
+ return <Camera className="h-4 w-4" />;
+ default:
+ return <Mouse className="h-4 w-4" />;
+ }
+ }
+ if (toolMessage.type === 'reasoning') {
+ return <Brain className="h-4 w-4" />;
+ }
+ return <Wrench className="h-4 w-4" />;
+ };
+
+ const getCallLabel = (toolMessage: AgentMessage): string => {
+ if (toolMessage.type === 'computer_call') {
+ const action = (toolMessage as ComputerCallMessage).action;
+ switch (action.type) {
+ case 'click':
+ return `Clicked ${action.button}`;
+ case 'type':
+ return 'Typed';
+ case 'screenshot':
+ return 'Took screenshot';
+ case 'scroll':
+ return 'Scrolled';
+ case 'keypress':
+ return 'Pressed keys';
+ default:
+ return `Used ${action.type}`;
+ }
+ }
+ if (toolMessage.type === 'reasoning') {
+ return 'Reasoning';
+ }
+ if (toolMessage.type === 'function_call') {
+ const functionCall = toolMessage as FunctionCallMessage;
+ const toolName = functionCall.name;
+
+ // Try to parse arguments and check for action property
+ try {
+ const args = JSON.parse(functionCall.arguments);
+ if (args.action) {
+ return `Used ${toolName}::${args.action}`;
+ }
+ } catch {
+ // If parsing fails, just use the tool name
+ }
+
+ return `Used ${toolName}`;
+ }
+ return 'Tool call';
+ };
+
+ return (
+ <div key={index} className="flex flex-col items-start gap-2">
+ <div className="prose prose-neutral dark:prose-invert prose-headings:my-3 prose-li:my-1 prose-p:my-2 prose-ul:my-2 max-w-4xl text-left">
+ <Markdown remarkPlugins={[remarkGfm]}>{renderContent(message.content)}</Markdown>
+ </div>
+
+ {/* Tool calls section - 2-row layout */}
+ {messageToolCalls && messageToolCalls.length > 0 && (
+ <div className="my-3 w-full max-w-[1400px] rounded-lg border border-neutral-200/50 dark:border-neutral-700/50">
+ {/* Row 1: Dropdown buttons */}
+ <div className="flex max-h-48 flex-col overflow-y-auto">
+ {messageToolCalls.map(({ message: toolMessage }, toolIndex) => {
+ const isExpanded = expandedCallIndex === toolIndex;
+ const isReasoning = toolMessage.type === 'reasoning';
+
+ return (
+ <button
+ key={`call-${toolIndex}`}
+ type="button"
+ onClick={() => toggleCallExpanded(toolIndex)}
+ className={`flex w-full items-center justify-between border-neutral-200/50 border-b px-3 py-1.5 text-sm transition-colors last:border-b-0 dark:border-neutral-700/50 ${
+ isExpanded
+ ? 'bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-white'
+ : 'text-neutral-600 hover:bg-neutral-50 dark:text-neutral-400 dark:hover:bg-neutral-800/50'
+ }`}
+ >
+ <div className="flex items-center gap-2">
+ {getCallIcon(toolMessage)}
+ <span>{getCallLabel(toolMessage)}</span>
+ </div>
+ {!isReasoning && (
+ <ChevronDown
+ className={`h-4 w-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}
+ />
+ )}
+ </button>
+ );
+ })}
+ </div>
+
+ {/* Row 2: Content area - show action details when expanded */}
+ {expandedCallIndex !== null && (
+ <div className="w-full bg-neutral-50 dark:bg-neutral-900">
+ <div className="space-y-4 p-4">
+ {(() => {
+ const {
+ message: toolMessage,
+ screenshot,
+ output,
+ } = messageToolCalls[expandedCallIndex];
+
+ if (toolMessage.type === 'reasoning') {
+ const reasoningCall = toolMessage as ReasoningMessage;
+ return (
+ <div className="space-y-2">
+ <div className="flex items-center gap-2 font-medium text-sm">
+ <Brain className="h-4 w-4 text-blue-600 dark:text-blue-400" />
+ <span>Reasoning</span>
+ </div>
+ <p className="rounded-md border bg-white p-3 text-neutral-700 text-sm dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200">
+ {reasoningCall.summary.map((s) => s.text).join(' ')}
+ </p>
+ </div>
+ );
+ }
+
+ if (toolMessage.type === 'function_call') {
+ const functionCall = toolMessage as FunctionCallMessage;
+ const functionOutput = output as FunctionCallOutputMessage | undefined;
+
+ return (
+ <div className="space-y-2">
+ {/* Arguments as JSON */}
+ <pre className="overflow-x-auto rounded-md border bg-neutral-100 p-3 font-mono text-neutral-700 text-xs dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200">
+ {JSON.stringify(JSON.parse(functionCall.arguments), null, 2)}
+ </pre>
+
+ {/* Function output/result */}
+ {functionOutput && (
+ <div className="space-y-1">
+ <div className="flex items-center gap-2 font-medium text-neutral-600 text-xs dark:text-neutral-400">
+ Result
+ </div>
+ <pre className="overflow-x-auto whitespace-pre-wrap rounded-md border bg-white p-3 text-neutral-700 text-xs dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200">
+ {functionOutput.output}
+ </pre>
+ </div>
+ )}
+ </div>
+ );
+ }
+
+ // For computer actions, show the action details as JSON
+ const action = (toolMessage as ComputerCallMessage).action;
+
+ return (
+ <div className="space-y-2">
+ {/* Action details as JSON */}
+ <pre className="overflow-x-auto rounded-md border bg-neutral-100 p-3 font-mono text-neutral-700 text-xs dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200">
+ {JSON.stringify(action, null, 2)}
+ </pre>
+
+ {/* Screenshot */}
+ {screenshot?.output?.image_url ? (
+ <img
+ src={screenshot.output.image_url}
+ alt="Screenshot"
+ className="w-full rounded border dark:border-neutral-700"
+ />
+ ) : (
+ <div className="flex items-center justify-center rounded border bg-white p-8 text-neutral-500 text-sm dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-400">
+ No screenshot available
+ </div>
+ )}
+ </div>
+ );
+ })()}
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+
+ {/* Copy button - show ONLY if this is the last message in a group of consecutive non-user messages */}
+ {isLastInGroup && (
+ <button
+ type="button"
+ onClick={handleCopy}
+ className="rounded-lg p-1.5 transition-all hover:bg-neutral-100 dark:hover:bg-neutral-800"
+ title="Copy all messages"
+ >
+ {copied ? (
+ <Check className="h-4 w-4 text-green-600 dark:text-green-400" />
+ ) : (
+ <Copy className="h-4 w-4 text-neutral-500 dark:text-neutral-400" />
+ )}
+ </button>
+ )}
+
+ {/* Duration subtext with animation */}
+ {msgDurationSeconds !== undefined && (
+ <div className="mt-1 flex items-center gap-2">
+ <ThinkingCompleteAnimation />
+ <p className="font-mono text-neutral-400 text-xs dark:text-neutral-500">
+ cuala thought for {msgDurationSeconds.toFixed(1)} seconds.
+ </p>
+ </div>
+ )}
+ </div>
+ );
+ };
+
+ const renderAssistantMessage = (message: AssistantMessage, index: string) => {
+ return (
+ <AssistantMessageComponent
+ message={message}
+ index={index}
+ toolCalls={toolCalls}
+ isLastInGroup={isLastInGroup}
+ durationSeconds={durationSeconds}
+ />
+ );
+ };
+
+ const renderReasoningMessage = (message: ReasoningMessage, index: string) => {
+ return (
+ <BaseAssistantMessage className="w-full" index={index}>
+ <div className="flex w-full flex-col">
+ <button
+ onClick={() => setIsReasoningExpanded(!isReasoningExpanded)}
+ type="button"
+ className="flex items-center gap-2 "
+ >
+ <Brain size={16} className="text-blue-600 dark:text-blue-400" />
+ <span className="font-medium text-sm dark:text-white">Agent Reasoning</span>
+ <motion.div
+ animate={{ rotate: isReasoningExpanded ? 90 : 0 }}
+ transition={{ duration: 0.2, ease: 'easeInOut' }}
+ className="ml-auto"
+ >
+ <ChevronRight size={16} className="text-neutral-600 dark:text-neutral-400" />
+ </motion.div>
+ </button>
+
+ <AnimatePresence>
+ {isReasoningExpanded && (
+ <motion.div
+ initial={{ height: 0, opacity: 0 }}
+ animate={{ height: 'auto', opacity: 1 }}
+ exit={{ height: 0 }}
+ transition={{
+ duration: 0.2,
+ ease: 'easeInOut',
+ opacity: { duration: 0.2 },
+ }}
+ className="overflow-hidden"
+ >
+ <p className="flex-1 pt-2 text-neutral-600 text-sm dark:text-neutral-300">
+ {message.summary.map((s) => s.text).join(' ')}
+ </p>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </div>
+ </BaseAssistantMessage>
+ );
+ };
+
+ const FunctionCallComponent = ({
+ message,
+ index,
+ }: {
+ message: FunctionCallMessage;
+ index: string;
+ }) => {
+ const [isExpanded, setIsExpanded] = useState(false);
+
+ return (
+ <BaseAssistantMessage index={index}>
+ <div className="my-1 flex w-full flex-col gap-2">
+ <button
+ onClick={() => setIsExpanded(!isExpanded)}
+ type="button"
+ className="flex w-full items-center justify-between gap-2"
+ >
+ <div className="flex items-center gap-2">
+ <Wrench size={16} className="text-blue-600 dark:text-blue-400" />
+ <span className="font-medium text-sm dark:text-white">
+ Used tool {message.name}
+ </span>
+ <span
+ className={`flex items-center gap-1 rounded-md px-1 py-1 text-xs ${
+ message.status === 'completed'
+ ? 'bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100'
+ : message.status === 'failed'
+ ? 'bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100'
+ : 'bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100'
+ }`}
+ >
+ {message.status === 'completed' && <CheckCircle size={12} />}
+ {message.status === 'failed' && <XCircle size={12} />}
+ {message.status === 'pending' && <Clock size={12} />}
+ </span>
+ </div>
+ <motion.div
+ animate={{ rotate: isExpanded ? 90 : 0 }}
+ transition={{ duration: 0.2, ease: 'easeInOut' }}
+ >
+ <ChevronRight size={16} className="text-neutral-600 dark:text-neutral-400" />
+ </motion.div>
+ </button>
+
+ <AnimatePresence>
+ {isExpanded && (
+ <motion.div
+ initial={{ height: 0, opacity: 0 }}
+ animate={{ height: 'auto', opacity: 1 }}
+ exit={{ height: 0, opacity: 0 }}
+ transition={{
+ duration: 0.2,
+ ease: 'easeInOut',
+ opacity: { duration: 0.2 },
+ }}
+ className="overflow-hidden"
+ >
+ <pre className="overflow-x-auto rounded-md border bg-neutral-50 p-3 text-neutral-700 text-xs dark:bg-neutral-900 dark:text-neutral-300">
+ {JSON.stringify(JSON.parse(message.arguments), null, 2)}
+ </pre>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </div>
+ </BaseAssistantMessage>
+ );
+ };
+
+ const renderFunctionCall = (message: FunctionCallMessage, index: string) => (
+ <FunctionCallComponent message={message} index={index} />
+ );
+
+ const renderFunctionOutput = (message: FunctionCallOutputMessage, index: string) => (
+ <BaseAssistantMessage index={index}>
+ <div className="my-1 flex flex-col gap-2">
+ <div className="flex items-center gap-2">
+ <Wrench size={16} className="text-blue-600 dark:text-blue-400" />
+ <span className="font-medium text-sm dark:text-white">Function Result</span>
+ </div>
+ <pre className="whitespace-pre-wrap rounded-md border bg-neutral-50 p-3 text-neutral-700 text-sm dark:bg-neutral-900 dark:text-neutral-300">
+ {message.output}
+ </pre>
+ </div>
+ </BaseAssistantMessage>
+ );
+
+ const renderMessage = (message: AgentMessage, index: string) => {
+ switch (message.type) {
+ case 'message':
+ return message.role === 'user' ||
+ message.role === 'system' ||
+ message.role === 'developer'
+ ? renderUserMessage(message as UserMessage, index)
+ : renderAssistantMessage(message as AssistantMessage, index);
+ case 'reasoning':
+ return renderReasoningMessage(message, index);
+ case 'computer_call':
+ // Computer calls are now rendered via ToolCallsGroup, not individually
+ return null;
+ case 'computer_call_output':
+ // Don't render computer_call_output messages independently anymore
+ return null;
+ case 'function_call':
+ return renderFunctionCall(message, index);
+ case 'function_call_output':
+ return renderFunctionOutput(message, index);
+ default:
+ return null;
+ }
+ };
+
+ return <div>{renderMessage(message, `${message.type}-${Math.random()}`)}</div>;
+ },
+ // Custom comparison function - only re-render if props actually change
+ (prevProps, nextProps) => {
+ // Compare message by reference (messages are immutable in the chat)
+ if (prevProps.message !== nextProps.message) return false;
+
+ // Compare screenshot by reference
+ if (prevProps.screenshot !== nextProps.screenshot) return false;
+
+ // Compare toolCalls array by reference
+ if (prevProps.toolCalls !== nextProps.toolCalls) return false;
+
+ // Compare isLastInGroup
+ if (prevProps.isLastInGroup !== nextProps.isLastInGroup) return false;
+
+ // Compare isLastConsecutiveUserMessage
+ if (prevProps.isLastConsecutiveUserMessage !== nextProps.isLastConsecutiveUserMessage)
+ return false;
+
+ // Compare durationSeconds
+ if (prevProps.durationSeconds !== nextProps.durationSeconds) return false;
+
+ // If all props are the same, don't re-render
+ return true;
+ }
+);
+
+ChatMessage.displayName = 'ChatMessage';
+
+export const getActionDescription = (action: ComputerAction): React.ReactNode => {
+ const baseClasses = 'inline-flex items-center gap-2 px-3 py-2 rounded-lg text-sm';
+ const colorClasses =
+ 'bg-white text-neutral-800 border border-neutral-200 shadow-sm dark:bg-neutral-900 dark:text-neutral-100 dark:border-neutral-700';
+
+ switch (action.type) {
+ case 'click':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Mouse className="h-4 w-4" />
+ <span>Click {action.button}</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.x}, {action.y})
+ </span>
+ </div>
+ );
+
+ case 'type':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Keyboard className="h-4 w-4" />
+ <span>Type:</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ "{action.text}"
+ </span>
+ </div>
+ );
+
+ case 'scroll':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Mouse className="h-4 w-4" />
+ <span>Scroll</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.scroll_x}, {action.scroll_y})
+ </span>
+ <span className="text-neutral-500 dark:text-neutral-400">at</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.x}, {action.y})
+ </span>
+ </div>
+ );
+
+ case 'keypress':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Keyboard className="h-4 w-4" />
+ <span>Press keys:</span>
+ <div className="flex gap-1">
+ {action.keys?.map((key, index) => (
+ <React.Fragment key={index}>
+ <kbd className="rounded border border-neutral-300 bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:border-neutral-600 dark:bg-neutral-700 dark:text-neutral-200">
+ {key}
+ </kbd>
+ {index < action.keys!.length - 1 && (
+ <span className="text-neutral-500 dark:text-neutral-400">+</span>
+ )}
+ </React.Fragment>
+ ))}
+ </div>
+ </div>
+ );
+
+ case 'screenshot':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Camera className="h-4 w-4" />
+ <span>Take screenshot</span>
+ </div>
+ );
+
+ case 'double_click':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <MousePointer className="h-4 w-4" />
+ <span>Double click</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.x}, {action.y})
+ </span>
+ </div>
+ );
+
+ case 'drag':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Move className="h-4 w-4" />
+ <span>Drag path with</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ {action.path?.length} points
+ </span>
+ </div>
+ );
+
+ case 'move':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Move className="h-4 w-4" />
+ <span>Move to</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.x}, {action.y})
+ </span>
+ </div>
+ );
+
+ case 'wait':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <Clock className="h-4 w-4" />
+ <span>Wait</span>
+ </div>
+ );
+
+ case 'left_mouse_down':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <ArrowDown className="h-4 w-4" />
+ <span>Mouse down</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.x}, {action.y})
+ </span>
+ </div>
+ );
+
+ case 'left_mouse_up':
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <ArrowUp className="h-4 w-4" />
+ <span>Mouse up</span>
+ <span className="rounded bg-neutral-100 px-2 py-0.5 font-mono text-xs dark:bg-neutral-700 dark:text-neutral-200">
+ ({action.x}, {action.y})
+ </span>
+ </div>
+ );
+
+ default:
+ return (
+ <div className={`${baseClasses} ${colorClasses}`}>
+ <RotateCcw className="h-4 w-4" />
+ <span>Computer action</span>
+ </div>
+ );
+ }
+};
diff --git a/libs/typescript/playground/src/components/primitives/CountdownTimer.tsx b/libs/typescript/playground/src/components/primitives/CountdownTimer.tsx
new file mode 100644
index 0000000000..f8484b4a40
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/CountdownTimer.tsx
@@ -0,0 +1,82 @@
+import { useEffect, useState } from 'react';
+
+interface CountdownTimerProps {
+ /** Total duration in seconds */
+ durationSeconds: number;
+ /** Callback when timer reaches 0 */
+ onTimeout: () => void;
+ /** Whether the timer is active */
+ isActive: boolean;
+}
+
+export function CountdownTimer({ durationSeconds, onTimeout, isActive }: CountdownTimerProps) {
+ const [secondsRemaining, setSecondsRemaining] = useState(durationSeconds);
+
+ // Reset timer when it becomes active
+ useEffect(() => {
+ if (isActive) {
+ setSecondsRemaining(durationSeconds);
+ }
+ }, [isActive, durationSeconds]);
+
+ // Countdown effect
+ useEffect(() => {
+ if (!isActive) return;
+
+ const interval = setInterval(() => {
+ setSecondsRemaining((prev) => {
+ if (prev <= 1) {
+ clearInterval(interval);
+ onTimeout();
+ return 0;
+ }
+ return prev - 1;
+ });
+ }, 1000);
+
+ return () => clearInterval(interval);
+ }, [isActive, onTimeout]);
+
+ if (!isActive) return null;
+
+ // SVG circle properties
+ const size = 14;
+ const strokeWidth = 2;
+ const radius = (size - strokeWidth) / 2;
+ const circumference = 2 * Math.PI * radius;
+ const progress = secondsRemaining / durationSeconds;
+ const strokeDashoffset = circumference * (1 - progress);
+
+ return (
+ <div className="flex items-center gap-1.5">
+ <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} className="rotate-[-90deg]">
+ {/* Background circle */}
+ <circle
+ cx={size / 2}
+ cy={size / 2}
+ r={radius}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={strokeWidth}
+ className="text-neutral-200 dark:text-neutral-700"
+ />
+ {/* Progress circle */}
+ <circle
+ cx={size / 2}
+ cy={size / 2}
+ r={radius}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={strokeWidth}
+ strokeDasharray={circumference}
+ strokeDashoffset={strokeDashoffset}
+ strokeLinecap="round"
+ className="text-neutral-400 transition-[stroke-dashoffset] duration-1000 ease-linear dark:text-neutral-500"
+ />
+ </svg>
+ <span className="text-neutral-400 text-xs dark:text-neutral-500">
+ {secondsRemaining}s until timeout
+ </span>
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/primitives/DeferredChatsLoader.tsx b/libs/typescript/playground/src/components/primitives/DeferredChatsLoader.tsx
new file mode 100644
index 0000000000..8aa2aa4ef6
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/DeferredChatsLoader.tsx
@@ -0,0 +1,33 @@
+import { useEffect, useRef } from 'react';
+import { usePlayground } from '../../hooks/usePlayground';
+import type { Chat } from '../../types';
+
+interface DeferredChatsLoaderProps {
+ chatsPromise: Promise<Chat[]>;
+}
+
+/**
+ * Component to handle deferred chat loading
+ * Loads chats asynchronously and dispatches to playground context
+ */
+export function DeferredChatsLoader({ chatsPromise }: DeferredChatsLoaderProps) {
+ const { dispatch } = usePlayground();
+ const hasLoadedRef = useRef(false);
+
+ useEffect(() => {
+ // Only load once
+ if (hasLoadedRef.current) return;
+ hasLoadedRef.current = true;
+
+ chatsPromise
+ .then((chats) => {
+ dispatch({ type: 'SET_CHATS', payload: chats });
+ })
+ .catch((error) => {
+ console.error('Failed to load chats:', error);
+ dispatch({ type: 'SET_ERROR', payload: 'Failed to load chats' });
+ });
+ }, [chatsPromise, dispatch]);
+
+ return null;
+}
diff --git a/libs/typescript/playground/src/components/primitives/ScrambledText.tsx b/libs/typescript/playground/src/components/primitives/ScrambledText.tsx
new file mode 100644
index 0000000000..4224f7ae25
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/ScrambledText.tsx
@@ -0,0 +1,75 @@
+import { useEffect, useMemo, useState } from 'react';
+
+const CHARACTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+
+interface ScrambledTextProps {
+ text: string;
+ className?: string;
+ scrambleDuration?: number;
+ revealDelay?: number;
+}
+
+export function ScrambledText({
+ text,
+ className = '',
+ scrambleDuration = 50,
+ revealDelay = 30,
+}: ScrambledTextProps) {
+ const [displayText, setDisplayText] = useState('');
+ const [revealedCount, setRevealedCount] = useState(0);
+
+ const scrambleChar = () => CHARACTERS[Math.floor(Math.random() * CHARACTERS.length)];
+
+ // biome-ignore lint/correctness/useExhaustiveDependencies: text dep needed to reset animation on phrase change
+ useEffect(() => {
+ setRevealedCount(0);
+ setDisplayText('');
+ }, [text]);
+
+ useEffect(() => {
+ if (revealedCount >= text.length) return;
+
+ const revealInterval = setInterval(() => {
+ setRevealedCount((prev) => Math.min(prev + 1, text.length));
+ }, revealDelay);
+
+ return () => clearInterval(revealInterval);
+ }, [text, revealDelay, revealedCount]);
+
+ // biome-ignore lint/correctness/useExhaustiveDependencies: scrambleChar is intentionally excluded to avoid infinite re-renders
+ useEffect(() => {
+ const scrambleInterval = setInterval(() => {
+ setDisplayText(
+ text
+ .split('')
+ .map((char, index) => {
+ if (char === ' ') return ' ';
+ if (index < revealedCount) return text[index];
+ return scrambleChar();
+ })
+ .join('')
+ );
+ }, scrambleDuration);
+
+ return () => clearInterval(scrambleInterval);
+ }, [text, revealedCount, scrambleDuration]);
+
+ const chars = useMemo(() => displayText.split(''), [displayText]);
+
+ return (
+ <span className={className}>
+ {chars.map((char, index) => (
+ <span
+ key={index}
+ className={
+ index < revealedCount
+ ? 'text-neutral-600 dark:text-neutral-400'
+ : 'text-neutral-400 dark:text-neutral-500'
+ }
+ >
+ {char}
+ </span>
+ ))}
+ </span>
+ );
+}
diff --git a/libs/typescript/playground/src/components/primitives/ThinkingCompleteAnimation.tsx b/libs/typescript/playground/src/components/primitives/ThinkingCompleteAnimation.tsx
new file mode 100644
index 0000000000..08c1143fdc
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/ThinkingCompleteAnimation.tsx
@@ -0,0 +1,51 @@
+import Lottie from 'lottie-react';
+import { useEffect, useState } from 'react';
+
+interface ThinkingCompleteAnimationProps {
+ className?: string;
+ lightAnimationUrl?: string;
+ darkAnimationUrl?: string;
+}
+
+export function ThinkingCompleteAnimation({
+ className = '',
+ lightAnimationUrl = '/playground/lfg_animation_black.json',
+ darkAnimationUrl = '/playground/lfg_animation_white.json',
+}: ThinkingCompleteAnimationProps) {
+ const [lightAnimation, setLightAnimation] = useState<object | null>(null);
+ const [darkAnimation, setDarkAnimation] = useState<object | null>(null);
+
+ useEffect(() => {
+ // Fetch both animation JSON files
+ fetch(lightAnimationUrl)
+ .then((res) => res.json())
+ .then(setLightAnimation)
+ .catch(() => {});
+
+ fetch(darkAnimationUrl)
+ .then((res) => res.json())
+ .then(setDarkAnimation)
+ .catch(() => {});
+ }, [lightAnimationUrl, darkAnimationUrl]);
+
+ return (
+ <>
+ {/* Light mode: black animation for light backgrounds */}
+ {lightAnimation && (
+ <Lottie
+ animationData={lightAnimation}
+ loop={false}
+ className={`h-4 w-4 dark:hidden ${className}`}
+ />
+ )}
+ {/* Dark mode: white animation for dark backgrounds */}
+ {darkAnimation && (
+ <Lottie
+ animationData={darkAnimation}
+ loop={false}
+ className={`hidden h-4 w-4 dark:block ${className}`}
+ />
+ )}
+ </>
+ );
+}
diff --git a/libs/typescript/playground/src/components/primitives/ThinkingIndicator.tsx b/libs/typescript/playground/src/components/primitives/ThinkingIndicator.tsx
new file mode 100644
index 0000000000..b57c08d5c7
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/ThinkingIndicator.tsx
@@ -0,0 +1,72 @@
+import Lottie from 'lottie-react';
+import { useEffect, useState } from 'react';
+import { ScrambledText } from './ScrambledText';
+
+const THINKING_PHRASES = [
+ 'cuala is brainstorming...',
+ 'cuala is ideating...',
+ 'cuala is philosophizing...',
+ 'cuala is pondering...',
+ 'cuala is contemplating...',
+ 'cuala is reasoning...',
+ 'cuala is analyzing...',
+ 'cuala is synthesizing...',
+];
+
+interface ThinkingIndicatorProps {
+ phrases?: string[];
+ lightAnimationUrl?: string;
+ darkAnimationUrl?: string;
+}
+
+export function ThinkingIndicator({
+ phrases = THINKING_PHRASES,
+ lightAnimationUrl = '/playground/thinking_animation_black.json',
+ darkAnimationUrl = '/playground/thinking_animation_white.json',
+}: ThinkingIndicatorProps) {
+ const [phraseIndex, setPhraseIndex] = useState(0);
+ const [lightAnimation, setLightAnimation] = useState<object | null>(null);
+ const [darkAnimation, setDarkAnimation] = useState<object | null>(null);
+
+ useEffect(() => {
+ const interval = setInterval(() => {
+ setPhraseIndex((prev) => (prev + 1) % phrases.length);
+ }, 3000);
+
+ return () => clearInterval(interval);
+ }, [phrases.length]);
+
+ useEffect(() => {
+ // Fetch both animation JSON files
+ fetch(lightAnimationUrl)
+ .then((res) => res.json())
+ .then(setLightAnimation)
+ .catch(() => {});
+
+ fetch(darkAnimationUrl)
+ .then((res) => res.json())
+ .then(setDarkAnimation)
+ .catch(() => {});
+ }, [lightAnimationUrl, darkAnimationUrl]);
+
+ return (
+ <div className="flex items-center gap-3">
+ <div className="flex items-center">
+ {/* Light mode: black animation for light backgrounds */}
+ {lightAnimation && (
+ <Lottie animationData={lightAnimation} loop={true} className="h-6 w-6 dark:hidden" />
+ )}
+ {/* Dark mode: white animation for dark backgrounds */}
+ {darkAnimation && (
+ <Lottie animationData={darkAnimation} loop={true} className="hidden h-6 w-6 dark:block" />
+ )}
+ </div>
+ <ScrambledText
+ text={phrases[phraseIndex]}
+ className="font-mono text-sm"
+ scrambleDuration={40}
+ revealDelay={50}
+ />
+ </div>
+ );
+}
diff --git a/libs/typescript/playground/src/components/primitives/ToolCallsGroup.tsx b/libs/typescript/playground/src/components/primitives/ToolCallsGroup.tsx
new file mode 100644
index 0000000000..66020a8f6b
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/ToolCallsGroup.tsx
@@ -0,0 +1,146 @@
+import { AnimatePresence, motion } from 'motion/react';
+import { Brain, Settings, TriangleAlert, Wrench } from 'lucide-react';
+import type React from 'react';
+import { useState } from 'react';
+import type {
+ AgentMessage,
+ ComputerCallMessage,
+ ComputerCallOutputMessage,
+ FunctionCallMessage,
+ ReasoningMessage,
+} from '../../types';
+import { getActionDescription } from './ChatMessage';
+
+interface ToolCallsGroupProps {
+ toolCalls: {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ }[];
+}
+
+export const ToolCallsGroup: React.FC<ToolCallsGroupProps> = ({ toolCalls }) => {
+ const [isExpanded, setIsExpanded] = useState(false);
+ const [selectedCallIndex, setSelectedCallIndex] = useState(1);
+
+ const getCallDescription = (message: AgentMessage): React.ReactNode => {
+ if (message.type === 'computer_call') {
+ const computerCall = message as ComputerCallMessage;
+ return getActionDescription(computerCall.action);
+ }
+ if (message.type === 'function_call') {
+ const functionCall = message as FunctionCallMessage;
+ return (
+ <>
+ <p className="mb-2 flex items-center gap-2 py-0.5 text-black text-sm dark:border-white dark:text-white">
+ <Wrench className="h-4 w-4" /> Function:
+ <span>{functionCall.name}</span>
+ </p>
+ <p className="rounded-md border bg-neutral-50 p-2 font-mono text-neutral-700 text-xs dark:text-neutral-200">
+ {functionCall.arguments}
+ </p>
+ </>
+ );
+ }
+ if (message.type === 'reasoning') {
+ const reasoningCall = message as ReasoningMessage;
+ return (
+ <>
+ <p className="mb-2 flex items-center gap-2 py-0.5 text-black text-xs dark:border-white dark:text-white">
+ <Brain className="h-4 w-4" /> Reasoning
+ </p>
+ <p className="rounded-md border bg-neutral-50 p-2 text-neutral-700 text-sm dark:bg-neutral-700 dark:text-neutral-200">
+ {reasoningCall.summary.map((s) => s.text).join(' ')}
+ </p>
+ </>
+ );
+ }
+ return (
+ <div className="inline-flex items-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-1.5 font-medium text-neutral-700 text-sm dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200">
+ <TriangleAlert className="h-4 w-4" />
+ <span className="text-sm">Unknown call</span>
+ </div>
+ );
+ };
+
+ const selectedScreenshot = toolCalls[selectedCallIndex]?.screenshot;
+
+ return (
+ <div className="flex flex-col items-start gap-2">
+ {/* Compact tool button with badge */}
+ <button
+ onClick={() => setIsExpanded(!isExpanded)}
+ className="group relative flex items-center gap-1.5 rounded-lg p-1.5 transition-all hover:bg-neutral-100 dark:hover:bg-neutral-800"
+ type="button"
+ title={`${toolCalls.length} tool call${toolCalls.length > 1 ? 's' : ''}`}
+ >
+ <Wrench className="h-4 w-4 text-neutral-500 dark:text-neutral-400" />
+ {/* Badge with count */}
+ <span className="flex h-4 min-w-4 items-center justify-center rounded-full bg-blue-600 px-1 text-white text-xs dark:bg-blue-500">
+ {toolCalls.length}
+ </span>
+ </button>
+
+ {/* Expanded tool calls panel */}
+ <AnimatePresence>
+ {isExpanded && (
+ <motion.div
+ initial={{ height: 0, opacity: 0 }}
+ animate={{ height: 'auto', opacity: 1 }}
+ exit={{ height: 0, opacity: 0 }}
+ transition={{
+ duration: 0.2,
+ ease: 'easeInOut',
+ }}
+ className="w-full overflow-hidden rounded-lg border border-neutral-300 bg-neutral-100 dark:border-neutral-400 dark:bg-neutral-800"
+ >
+ <div className="flex items-center gap-2 border-neutral-200 border-b px-4 py-2 dark:border-neutral-600">
+ <Settings size={16} className="text-blue-600 dark:text-blue-400" />
+ <span className="font-medium text-sm dark:text-white">
+ Tool Calls ({toolCalls.length})
+ </span>
+ </div>
+ <div className="border-neutral-200 border-t dark:border-neutral-600">
+ <div className="flex h-96 p-4">
+ {/* Screenshot display area */}
+ <div className="mr-4 flex flex-1 items-center justify-center rounded-lg border border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-900">
+ {selectedScreenshot?.output?.image_url ? (
+ <img
+ src={selectedScreenshot.output.image_url}
+ alt="Screenshot"
+ className="max-h-full max-w-full rounded object-contain"
+ />
+ ) : (
+ <div className="text-neutral-500 text-sm dark:text-neutral-400">
+ No screenshot available
+ </div>
+ )}
+ </div>
+
+ {/* Scrollable calls list */}
+ <div className="flex w-72 flex-col">
+ <div className="flex-1 space-y-3 overflow-y-auto px-1">
+ {toolCalls.map(({ message }, index) => (
+ <button
+ key={`call-${index}`}
+ type="button"
+ onClick={() => setSelectedCallIndex(index)}
+ disabled={message.type === 'reasoning'}
+ className={`w-full rounded border p-2 text-left text-neutral-700 transition-colors disabled:cursor-default! dark:text-neutral-300 ${
+ selectedCallIndex === index
+ ? 'border-blue-300 bg-blue-100 dark:border-blue-700 dark:bg-blue-900 '
+ : 'border-neutral-200 bg-white hover:enabled:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:hover:enabled:bg-neutral-700'
+ }`}
+ >
+ <div className="">{getCallDescription(message)}</div>
+ </button>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </div>
+ );
+};
diff --git a/libs/typescript/playground/src/components/primitives/VMStatusBanner.tsx b/libs/typescript/playground/src/components/primitives/VMStatusBanner.tsx
new file mode 100644
index 0000000000..2251c72163
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/VMStatusBanner.tsx
@@ -0,0 +1,198 @@
+import { X } from 'lucide-react';
+import { motion } from 'motion/react';
+import type { VM } from '../../types';
+import { isVM } from '../../types';
+
+/**
+ * Version info for a VM, used to determine if warning banners should show
+ */
+export interface VMVersionInfo {
+ isOutdated?: boolean;
+ unreachable?: boolean;
+}
+
+interface VMStatusBannerProps {
+ /** Callback when restart button is clicked */
+ onRestartVM: (vm: VM) => void;
+ /** Callback when start button is clicked */
+ onStartVM: (vm: VM) => void;
+ /** Callback when action button is clicked (for no-sandbox scenarios) */
+ onAction?: (action: string) => void;
+ /** Whether the user has an organization set up */
+ hasOrg: boolean;
+ /** Whether the user has a workspace set up */
+ hasWorkspace: boolean;
+ /** Whether the user has credits available */
+ hasCredits: boolean;
+ /** Organization slug for building links */
+ orgSlug?: string;
+ /** List of available computers/sandboxes */
+ computers: Array<VM | { id: string; url: string; name: string }>;
+ /** Currently selected computer */
+ computer?: VM | { id: string; url: string; name: string } | null;
+ /** VM version info map (vmId -> VMVersionInfo) */
+ vmVersionInfo?: Map<string, VMVersionInfo>;
+ /** Currently dismissed VM warning ID */
+ dismissedVmWarning?: string | null;
+ /** Callback when warning is dismissed */
+ onDismissWarning?: (vmId: string) => void;
+}
+
+/**
+ * Displays status banners for VM-related issues:
+ * - No sandboxes available (with setup guidance)
+ * - Sandbox offline
+ * - Sandbox outdated or unreachable
+ *
+ * Adapted from cloud/src/website/app/components/playground/VMStatusBanner.tsx
+ * Uses props instead of context for better reusability across different applications.
+ */
+export function VMStatusBanner({
+ onRestartVM,
+ onStartVM,
+ onAction,
+ hasOrg,
+ hasWorkspace,
+ hasCredits,
+ orgSlug,
+ computers,
+ computer,
+ vmVersionInfo,
+ dismissedVmWarning,
+ onDismissWarning,
+}: VMStatusBannerProps) {
+ // No sandboxes banner - show different messages based on setup state
+ if (computers.length === 0) {
+ // Determine message and action based on setup state
+ let title = 'No Sandboxes Available';
+ let message = 'Create your first sandbox to start using the playground.';
+ let buttonText = 'Create Sandbox';
+ let actionType = 'create-sandbox';
+
+ if (!hasOrg) {
+ title = 'Set Up Your Organization';
+ message = 'Create an organization to start using sandboxes.';
+ buttonText = 'Get Started';
+ actionType = 'get-started';
+ } else if (!hasWorkspace) {
+ title = 'Create a Workspace';
+ message = 'Create a workspace to manage your sandboxes.';
+ buttonText = 'Create Workspace';
+ actionType = 'create-workspace';
+ } else if (!hasCredits) {
+ message = 'Purchase credits to create a sandbox.';
+ buttonText = 'Purchase Credits';
+ actionType = 'purchase-credits';
+ }
+
+ return (
+ <motion.div
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: 10 }}
+ className="mb-4 flex items-center justify-between gap-3 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-900/50 dark:bg-blue-950/30"
+ >
+ <div className="flex-1">
+ <p className="font-medium text-blue-900 text-sm dark:text-blue-200">{title}</p>
+ <p className="mt-0.5 text-blue-700 text-xs dark:text-blue-300">{message}</p>
+ </div>
+ <button
+ type="button"
+ onClick={() => onAction?.(actionType)}
+ className="rounded-md bg-blue-600 px-3 py-1.5 font-medium text-white text-xs transition-colors hover:bg-blue-700 dark:bg-blue-700 dark:hover:bg-blue-600"
+ >
+ {buttonText}
+ </button>
+ </motion.div>
+ );
+ }
+
+ // No computer selected or not a VM
+ if (!computer || !isVM(computer)) {
+ return null;
+ }
+
+ const vm = computer as VM;
+
+ // Offline banner
+ if (vm.status !== 'running' && vm.status !== 'restarting' && vm.status !== 'starting') {
+ return (
+ <motion.div
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: 10 }}
+ className="mb-4 flex items-center justify-between gap-3 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900/50 dark:bg-red-950/30"
+ >
+ <div className="flex-1">
+ <p className="font-medium text-red-900 text-sm dark:text-red-200">Sandbox Offline</p>
+ <p className="mt-0.5 text-red-700 text-xs dark:text-red-300">
+ This sandbox is not running. Start it to begin using it.
+ </p>
+ </div>
+ <button
+ type="button"
+ onClick={(e) => {
+ e.preventDefault();
+ onStartVM(vm);
+ }}
+ className="rounded-md bg-red-600 px-3 py-1.5 font-medium text-white text-xs transition-colors hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"
+ >
+ Start
+ </button>
+ </motion.div>
+ );
+ }
+
+ // Outdated/Unreachable banner
+ const versionInfo = vmVersionInfo?.get(vm.vmId);
+ const shouldShowWarning =
+ (versionInfo?.isOutdated || versionInfo?.unreachable) && dismissedVmWarning !== vm.vmId;
+
+ if (!shouldShowWarning) {
+ return null;
+ }
+
+ return (
+ <motion.div
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ exit={{ opacity: 0, y: 10 }}
+ className="mb-4 flex items-center justify-between gap-3 rounded-lg border border-orange-200 bg-orange-50 p-3 dark:border-orange-900/50 dark:bg-orange-950/30"
+ >
+ <div className="flex-1">
+ <p className="font-medium text-orange-900 text-sm dark:text-orange-200">
+ {versionInfo?.unreachable ? 'Sandbox Not Responding' : 'Sandbox Outdated'}
+ </p>
+ <p className="mt-0.5 text-orange-700 text-xs dark:text-orange-300">
+ {versionInfo?.unreachable
+ ? 'The sandbox is slow to respond. Try waiting a moment or restarting it.'
+ : 'The computer-server is out of date. Restart the sandbox to update.'}
+ </p>
+ </div>
+ <div className="flex items-center gap-2">
+ <button
+ type="button"
+ onClick={(e) => {
+ e.preventDefault();
+ onRestartVM(vm);
+ }}
+ disabled={vm.status === 'restarting'}
+ className="rounded-md bg-orange-600 px-3 py-1.5 font-medium text-white text-xs transition-colors hover:bg-orange-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-orange-700 dark:hover:bg-orange-600"
+ >
+ {vm.status === 'restarting' ? 'Restarting...' : 'Restart'}
+ </button>
+ {onDismissWarning && (
+ <button
+ type="button"
+ onClick={() => onDismissWarning(vm.vmId)}
+ className="flex h-6 w-6 items-center justify-center rounded text-orange-600 transition-colors hover:bg-orange-100 dark:text-orange-400 dark:hover:bg-orange-900/50"
+ >
+ <X className="h-4 w-4" />
+ </button>
+ )}
+ </div>
+ </motion.div>
+ );
+}
+
+export type { VMStatusBannerProps };
diff --git a/libs/typescript/playground/src/components/primitives/VNCIframe.tsx b/libs/typescript/playground/src/components/primitives/VNCIframe.tsx
new file mode 100644
index 0000000000..a63f634922
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/VNCIframe.tsx
@@ -0,0 +1,52 @@
+import React from 'react';
+
+interface VNCIframeProps {
+ src: string;
+ width?: number;
+ height?: number;
+}
+
+/**
+ * Memoized VNC iframe component to prevent unnecessary re-renders.
+ * This component will only re-render if src, width, or height actually change.
+ *
+ * Note: This is functionally identical to VNCViewer.tsx but kept as a separate
+ * component for compatibility with imports from cloud repo patterns.
+ */
+const VNCIframe = React.memo(
+ ({ src, width, height }: VNCIframeProps) => {
+ // Use provided dimensions or fall back to 16:9 aspect ratio
+ const aspectRatio = width && height ? width / height : 16 / 9;
+
+ return (
+ <div
+ className="w-full"
+ style={{
+ aspectRatio: aspectRatio.toString(),
+ maxHeight: height ? `${height}px` : undefined,
+ }}
+ >
+ <iframe
+ key={src}
+ src={src}
+ className="h-full w-full"
+ title="VNC Viewer"
+ allow="clipboard-read; clipboard-write"
+ />
+ </div>
+ );
+ },
+ // Custom comparison function - only re-render if src, width, or height actually change
+ (prevProps, nextProps) => {
+ return (
+ prevProps.src === nextProps.src &&
+ prevProps.width === nextProps.width &&
+ prevProps.height === nextProps.height
+ );
+ }
+);
+
+VNCIframe.displayName = 'VNCIframe';
+
+export default VNCIframe;
+export type { VNCIframeProps };
diff --git a/libs/typescript/playground/src/components/primitives/VNCOverlayPanel.tsx b/libs/typescript/playground/src/components/primitives/VNCOverlayPanel.tsx
new file mode 100644
index 0000000000..9b40d3e631
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/VNCOverlayPanel.tsx
@@ -0,0 +1,377 @@
+import { GripVertical, Maximize2, Minimize2, Monitor, X } from 'lucide-react';
+import { AnimatePresence, motion, useDragControls } from 'motion/react';
+import {
+ type PointerEvent as ReactPointerEvent,
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+} from 'react';
+import VNCIframe from './VNCIframe';
+
+// Inline useIsMobile hook since the playground package doesn't have this hook
+function useIsMobile(): boolean {
+ const [isMobile, setIsMobile] = useState(false);
+
+ useEffect(() => {
+ const checkMobile = () => {
+ setIsMobile(window.innerWidth < 768);
+ };
+
+ checkMobile();
+ window.addEventListener('resize', checkMobile);
+ return () => window.removeEventListener('resize', checkMobile);
+ }, []);
+
+ return isMobile;
+}
+
+interface VNCOverlayPanelProps {
+ vncUrl: string | null;
+ isOpen: boolean;
+ onToggle: () => void;
+ width?: number;
+ height?: number;
+}
+
+const MIN_WIDTH = 240;
+const MAX_WIDTH = 800;
+const MIN_HEIGHT = 135; // Roughly 16:9 at MIN_WIDTH
+const DEFAULT_WIDTH = 320;
+const DEFAULT_HEIGHT = 180;
+const HEADER_HEIGHT = 32;
+const MARGIN = 24;
+
+/**
+ * Floating VNC mini-player that appears at the bottom-left of the screen,
+ * similar to YouTube's mini-player. Hidden on mobile devices.
+ * Supports dragging within the viewport and resizing by dragging edges/corners.
+ */
+export function VNCOverlayPanel({
+ vncUrl,
+ isOpen,
+ onToggle,
+ width: propWidth,
+ height: propHeight,
+}: VNCOverlayPanelProps) {
+ const isMobile = useIsMobile();
+ const dragControls = useDragControls();
+ const constraintsRef = useRef<HTMLDivElement>(null);
+
+ // Panel size state
+ const [size, setSize] = useState({
+ width: DEFAULT_WIDTH,
+ height: DEFAULT_HEIGHT,
+ });
+
+ // Panel position state (top-left based)
+ const [position, setPosition] = useState<{ x: number; y: number } | null>(null);
+
+ // Resize state
+ const [isResizing, setIsResizing] = useState(false);
+ const resizeRef = useRef<{
+ startX: number;
+ startY: number;
+ startWidth: number;
+ startHeight: number;
+ direction: string;
+ } | null>(null);
+
+ // Initialize position on first render (bottom-left of viewport)
+ useEffect(() => {
+ if (typeof window !== 'undefined' && position === null) {
+ setPosition({
+ x: MARGIN,
+ y: window.innerHeight - (size.height + HEADER_HEIGHT) - MARGIN,
+ });
+ }
+ }, [position, size.height]);
+
+ // Handle resize move - must be declared before handleResizeEnd
+ const handleResizeMove = useCallback((e: globalThis.PointerEvent) => {
+ if (!resizeRef.current) return;
+
+ const { startX, startY, startWidth, startHeight, direction } = resizeRef.current;
+ const deltaX = e.clientX - startX;
+ const deltaY = e.clientY - startY;
+
+ let newWidth = startWidth;
+ let newHeight = startHeight;
+
+ // Calculate new dimensions based on direction
+ if (direction.includes('e')) {
+ newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, startWidth + deltaX));
+ }
+ if (direction.includes('w')) {
+ newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, startWidth - deltaX));
+ }
+ if (direction.includes('s')) {
+ newHeight = Math.max(MIN_HEIGHT, startHeight + deltaY);
+ }
+ if (direction.includes('n')) {
+ newHeight = Math.max(MIN_HEIGHT, startHeight - deltaY);
+ }
+
+ setSize({ width: newWidth, height: newHeight });
+ }, []);
+
+ // Handle resize end
+ const handleResizeEnd = useCallback(() => {
+ setIsResizing(false);
+ resizeRef.current = null;
+ document.removeEventListener('pointermove', handleResizeMove);
+ document.removeEventListener('pointerup', handleResizeEnd);
+ }, [handleResizeMove]);
+
+ // Cleanup listeners on unmount
+ useEffect(() => {
+ return () => {
+ document.removeEventListener('pointermove', handleResizeMove);
+ document.removeEventListener('pointerup', handleResizeEnd);
+ };
+ }, [handleResizeMove, handleResizeEnd]);
+
+ // Don't render anything on mobile
+ if (isMobile) {
+ return null;
+ }
+
+ // Don't render if no VNC URL available
+ if (!vncUrl) {
+ return null;
+ }
+
+ // Handle resize start
+ const handleResizeStart = (e: ReactPointerEvent<HTMLDivElement>, direction: string) => {
+ e.preventDefault();
+ e.stopPropagation();
+ setIsResizing(true);
+ resizeRef.current = {
+ startX: e.clientX,
+ startY: e.clientY,
+ startWidth: size.width,
+ startHeight: size.height,
+ direction,
+ };
+
+ // Add global listeners
+ document.addEventListener('pointermove', handleResizeMove);
+ document.addEventListener('pointerup', handleResizeEnd);
+ };
+
+ // Cycle through preset sizes
+ const cycleSize = () => {
+ const presets = [
+ { width: 280, height: 158 },
+ { width: 360, height: 203 },
+ { width: 480, height: 270 },
+ ];
+
+ // Find closest preset and cycle to next
+ const currentArea = size.width * size.height;
+ let closestIndex = 0;
+ let closestDiff = Infinity;
+
+ presets.forEach((preset, index) => {
+ const diff = Math.abs(preset.width * preset.height - currentArea);
+ if (diff < closestDiff) {
+ closestDiff = diff;
+ closestIndex = index;
+ }
+ });
+
+ const nextIndex = (closestIndex + 1) % presets.length;
+ setSize(presets[nextIndex]);
+ };
+
+ // Check if current size is "large"
+ const isLargeSize = size.width >= 440;
+
+ // Start drag from header
+ const startDrag = (e: ReactPointerEvent<HTMLDivElement>) => {
+ if (isResizing) return;
+ dragControls.start(e);
+ };
+
+ const totalHeight = size.height + HEADER_HEIGHT;
+
+ return (
+ <>
+ {/* Invisible constraints container that covers the viewport */}
+ <div ref={constraintsRef} className="pointer-events-none fixed inset-0" />
+
+ {/* Floating toggle button - visible when mini-player is closed */}
+ <AnimatePresence>
+ {!isOpen && (
+ <motion.button
+ type="button"
+ initial={{ opacity: 0, scale: 0.8 }}
+ animate={{ opacity: 1, scale: 1 }}
+ exit={{ opacity: 0, scale: 0.8 }}
+ transition={{ duration: 0.2, ease: [0.4, 0, 0.2, 1] }}
+ onClick={onToggle}
+ className="group fixed bottom-6 left-6 z-[70] flex h-12 w-12 items-center justify-center rounded-full bg-neutral-900 text-white shadow-lg transition-colors hover:bg-neutral-800 dark:bg-neutral-700 dark:hover:bg-neutral-600"
+ >
+ <Monitor className="h-5 w-5" />
+ {/* Tooltip on hover - positioned to the right */}
+ <span className="-translate-y-1/2 pointer-events-none absolute top-1/2 left-full ml-3 whitespace-nowrap rounded-md bg-neutral-800 px-3 py-1.5 text-white text-xs opacity-0 shadow-lg transition-opacity group-hover:opacity-100 dark:bg-neutral-700">
+ Click for live view of computer
+ </span>
+ </motion.button>
+ )}
+ </AnimatePresence>
+
+ {/* Floating mini-player - draggable and resizable */}
+ <AnimatePresence>
+ {isOpen && position && (
+ <motion.div
+ drag
+ dragControls={dragControls}
+ dragListener={false}
+ dragMomentum={false}
+ dragElastic={0}
+ dragConstraints={constraintsRef}
+ initial={{
+ opacity: 0,
+ scale: 0.95,
+ x: position.x,
+ y: position.y,
+ }}
+ animate={{
+ opacity: 1,
+ scale: 1,
+ width: size.width,
+ height: totalHeight,
+ }}
+ exit={{ opacity: 0, scale: 0.95 }}
+ transition={{
+ duration: 0.2,
+ ease: [0.4, 0, 0.2, 1],
+ width: { duration: isResizing ? 0 : 0.2 },
+ height: { duration: isResizing ? 0 : 0.2 },
+ }}
+ className="fixed top-0 left-0 z-[70] flex flex-col overflow-hidden rounded-xl bg-neutral-900 shadow-2xl"
+ style={{
+ cursor: isResizing ? 'grabbing' : undefined,
+ }}
+ >
+ {/* Header with title and controls - drag handle */}
+ <div
+ onPointerDown={startDrag}
+ className="flex h-8 flex-shrink-0 cursor-grab items-center justify-between bg-neutral-800 px-1 active:cursor-grabbing"
+ >
+ <div className="flex items-center gap-1 text-neutral-300 text-xs">
+ {/* Drag grip indicator */}
+ <GripVertical className="h-4 w-4 text-neutral-500" />
+ <Monitor className="h-3.5 w-3.5" />
+ <span>Live View</span>
+ </div>
+ <div className="flex items-center gap-1">
+ {/* Resize button */}
+ <button
+ type="button"
+ onClick={cycleSize}
+ className="flex h-6 w-6 items-center justify-center rounded text-neutral-400 transition-colors hover:bg-neutral-700 hover:text-white"
+ title="Cycle size presets"
+ >
+ {isLargeSize ? (
+ <Minimize2 className="h-3.5 w-3.5" />
+ ) : (
+ <Maximize2 className="h-3.5 w-3.5" />
+ )}
+ </button>
+ {/* Close button */}
+ <button
+ type="button"
+ onClick={onToggle}
+ className="flex h-6 w-6 items-center justify-center rounded text-neutral-400 transition-colors hover:bg-neutral-700 hover:text-white"
+ title="Close mini-player"
+ >
+ <X className="h-4 w-4" />
+ </button>
+ </div>
+ </div>
+
+ {/* VNC iframe container */}
+ <div className="relative flex-1 bg-black" style={{ height: size.height }}>
+ <VNCIframe src={vncUrl} width={propWidth} height={propHeight} />
+
+ {/* Resize handles - edges first, then corners on top */}
+ {/* Right edge */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'e')}
+ className="absolute top-2 right-0 bottom-2 w-2 cursor-e-resize opacity-0 transition-opacity hover:bg-white/20 hover:opacity-100"
+ />
+ {/* Bottom edge */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 's')}
+ className="absolute right-2 bottom-0 left-2 h-2 cursor-s-resize opacity-0 transition-opacity hover:bg-white/20 hover:opacity-100"
+ />
+ {/* Left edge */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'w')}
+ className="absolute top-2 bottom-2 left-0 w-2 cursor-w-resize opacity-0 transition-opacity hover:bg-white/20 hover:opacity-100"
+ />
+ {/* Top edge */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'n')}
+ className="absolute top-0 right-2 left-2 h-2 cursor-n-resize opacity-0 transition-opacity hover:bg-white/20 hover:opacity-100"
+ />
+
+ {/* Corner handles - higher z-index to be on top of edges */}
+ {/* Bottom-right corner - visible resize handle */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'se')}
+ className="absolute right-0 bottom-0 z-10 flex h-5 w-5 cursor-se-resize items-end justify-end p-0.5"
+ >
+ {/* Resize grip lines */}
+ <svg
+ width="10"
+ height="10"
+ viewBox="0 0 10 10"
+ className="text-neutral-500 transition-colors hover:text-neutral-300"
+ >
+ <line
+ x1="9"
+ y1="1"
+ x2="1"
+ y2="9"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ />
+ <line
+ x1="9"
+ y1="5"
+ x2="5"
+ y2="9"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ />
+ </svg>
+ </div>
+ {/* Top-right corner */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'ne')}
+ className="absolute top-0 right-0 z-10 h-4 w-4 cursor-ne-resize opacity-0 transition-opacity hover:bg-white/30 hover:opacity-100"
+ />
+ {/* Bottom-left corner */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'sw')}
+ className="absolute bottom-0 left-0 z-10 h-4 w-4 cursor-sw-resize opacity-0 transition-opacity hover:bg-white/30 hover:opacity-100"
+ />
+ {/* Top-left corner */}
+ <div
+ onPointerDown={(e) => handleResizeStart(e, 'nw')}
+ className="absolute top-0 left-0 z-10 h-4 w-4 cursor-nw-resize opacity-0 transition-opacity hover:bg-white/30 hover:opacity-100"
+ />
+ </div>
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </>
+ );
+}
+
+export type { VNCOverlayPanelProps };
diff --git a/libs/typescript/playground/src/components/primitives/VNCViewer.tsx b/libs/typescript/playground/src/components/primitives/VNCViewer.tsx
new file mode 100644
index 0000000000..30a23225a6
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/VNCViewer.tsx
@@ -0,0 +1,49 @@
+import React from 'react';
+
+interface VNCViewerProps {
+ src: string;
+ width?: number;
+ height?: number;
+}
+
+/**
+ * Memoized VNC iframe component to prevent unnecessary re-renders.
+ * This component will only re-render if src, width, or height actually change.
+ */
+const VNCViewer = React.memo(
+ ({ src, width, height }: VNCViewerProps) => {
+ // Use provided dimensions or fall back to 16:9 aspect ratio
+ const aspectRatio = width && height ? width / height : 16 / 9;
+
+ return (
+ <div
+ className="w-full"
+ style={{
+ aspectRatio: aspectRatio.toString(),
+ maxHeight: height ? `${height}px` : undefined,
+ }}
+ >
+ <iframe
+ key={src}
+ src={src}
+ className="h-full w-full"
+ title="VNC Viewer"
+ allow="clipboard-read; clipboard-write"
+ />
+ </div>
+ );
+ },
+ // Custom comparison function - only re-render if src, width, or height actually change
+ (prevProps, nextProps) => {
+ return (
+ prevProps.src === nextProps.src &&
+ prevProps.width === nextProps.width &&
+ prevProps.height === nextProps.height
+ );
+ }
+);
+
+VNCViewer.displayName = 'VNCViewer';
+
+export { VNCViewer };
+export type { VNCViewerProps };
diff --git a/libs/typescript/playground/src/components/primitives/index.ts b/libs/typescript/playground/src/components/primitives/index.ts
new file mode 100644
index 0000000000..dafa97ee16
--- /dev/null
+++ b/libs/typescript/playground/src/components/primitives/index.ts
@@ -0,0 +1,16 @@
+export { ChatMessage, getActionDescription } from './ChatMessage';
+export { ChatInput } from './ChatInput';
+export { ToolCallsGroup } from './ToolCallsGroup';
+export { VNCViewer } from './VNCViewer';
+export type { VNCViewerProps } from './VNCViewer';
+export { default as VNCIframe } from './VNCIframe';
+export type { VNCIframeProps } from './VNCIframe';
+export { VNCOverlayPanel } from './VNCOverlayPanel';
+export type { VNCOverlayPanelProps } from './VNCOverlayPanel';
+export { VMStatusBanner } from './VMStatusBanner';
+export type { VMStatusBannerProps, VMVersionInfo } from './VMStatusBanner';
+export { ThinkingIndicator } from './ThinkingIndicator';
+export { ThinkingCompleteAnimation } from './ThinkingCompleteAnimation';
+export { ScrambledText } from './ScrambledText';
+export { CountdownTimer } from './CountdownTimer';
+export { DeferredChatsLoader } from './DeferredChatsLoader';
diff --git a/libs/typescript/playground/src/components/ui/Modal.tsx b/libs/typescript/playground/src/components/ui/Modal.tsx
new file mode 100644
index 0000000000..f7f2a695b8
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/Modal.tsx
@@ -0,0 +1,108 @@
+import { X } from 'lucide-react';
+import type React from 'react';
+import { useEffect, useState } from 'react';
+import { createPortal } from 'react-dom';
+import { cn } from '../../utils/cn';
+
+export interface ModalProps {
+ isOpen: boolean;
+ onClose: () => void;
+ title?: string;
+ description?: string;
+ children: React.ReactNode;
+ className?: string;
+ contentClassName?: string;
+ showCloseButton?: boolean;
+ closeOnOutsideClick?: boolean;
+}
+
+export const Modal = ({
+ isOpen,
+ onClose,
+ children,
+ className,
+ contentClassName,
+ showCloseButton = true,
+ closeOnOutsideClick = true,
+}: ModalProps) => {
+ const [isMounted, setIsMounted] = useState(false);
+
+ useEffect(() => {
+ setIsMounted(true);
+
+ if (isOpen) {
+ document.body.style.overflow = 'hidden';
+ }
+
+ return () => {
+ document.body.style.overflow = 'auto';
+ };
+ }, [isOpen]);
+
+ useEffect(() => {
+ const handleEscape = (e: KeyboardEvent) => {
+ if (e.key === 'Escape') {
+ onClose();
+ }
+ };
+
+ if (isOpen) {
+ document.addEventListener('keydown', handleEscape);
+ }
+
+ return () => {
+ document.removeEventListener('keydown', handleEscape);
+ };
+ }, [isOpen, onClose]);
+
+ const handleBackdropClick = (e: React.MouseEvent | React.KeyboardEvent) => {
+ // For keyboard events, ignore if modifier keys are pressed
+ if ('key' in e && (e.ctrlKey || e.metaKey || e.altKey || e.shiftKey)) {
+ return;
+ }
+
+ if (closeOnOutsideClick && e.target === e.currentTarget) {
+ onClose();
+ }
+ };
+
+ if (!isMounted || !isOpen) {
+ return null;
+ }
+
+ const modalContent = (
+ <dialog
+ className={cn(
+ 'fixed inset-0 z-[60] flex h-full w-full items-center justify-center bg-black/50 px-4 backdrop-blur-sm md:px-0',
+ className
+ )}
+ onClick={handleBackdropClick}
+ onKeyDown={handleBackdropClick}
+ aria-modal="true"
+ >
+ <div
+ className={cn(
+ 'fade-in-0 zoom-in-95 animate-in duration-200',
+ 'relative w-full max-w-xl rounded-lg border bg-white p-6 shadow-lg dark:border-neutral-700 dark:bg-neutral-800',
+ 'overflow-y-auto',
+ contentClassName
+ )}
+ >
+ {showCloseButton && (
+ <button
+ type="button"
+ onClick={onClose}
+ className="absolute top-4 right-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-400 focus:ring-offset-2 disabled:pointer-events-none dark:text-neutral-300 dark:ring-offset-neutral-800 dark:focus:ring-neutral-500"
+ aria-label="Close modal"
+ >
+ <X className="h-4 w-4" />
+ </button>
+ )}
+
+ {children}
+ </div>
+ </dialog>
+ );
+
+ return createPortal(modalContent, document.body);
+};
diff --git a/libs/typescript/playground/src/components/ui/button.tsx b/libs/typescript/playground/src/components/ui/button.tsx
new file mode 100644
index 0000000000..fd05870dae
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/button.tsx
@@ -0,0 +1,59 @@
+import { Slot } from '@radix-ui/react-slot';
+import { cva, type VariantProps } from 'class-variance-authority';
+import type * as React from 'react';
+
+import { cn } from '../../utils/cn';
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ {
+ variants: {
+ variant: {
+ default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
+ destructive:
+ 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
+ outline:
+ 'border bg-background text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:text-foreground dark:hover:bg-input/50',
+ secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
+ ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
+ link: 'text-primary underline-offset-4 hover:underline',
+ },
+ size: {
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
+ sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
+ icon: 'size-9',
+ },
+ },
+ defaultVariants: {
+ variant: 'default',
+ size: 'default',
+ },
+ }
+);
+
+function Button({
+ className,
+ variant,
+ size,
+ asChild = false,
+ children,
+ ...props
+}: React.ComponentProps<'button'> &
+ VariantProps<typeof buttonVariants> & {
+ asChild?: boolean;
+ }) {
+ const Comp = asChild ? Slot : 'button';
+
+ return (
+ <Comp
+ data-slot="button"
+ className={cn(buttonVariants({ variant, size, className }))}
+ {...props}
+ >
+ {children}
+ </Comp>
+ );
+}
+
+export { Button, buttonVariants };
diff --git a/libs/typescript/playground/src/components/ui/dialog.tsx b/libs/typescript/playground/src/components/ui/dialog.tsx
new file mode 100644
index 0000000000..1ef8f910c7
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/dialog.tsx
@@ -0,0 +1,127 @@
+import * as DialogPrimitive from '@radix-ui/react-dialog';
+import { XIcon } from 'lucide-react';
+import type * as React from 'react';
+
+import { cn } from '../../utils/cn';
+
+function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />;
+}
+
+function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
+}
+
+function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
+}
+
+function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
+}
+
+function DialogOverlay({
+ className,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
+ return (
+ <DialogPrimitive.Overlay
+ data-slot="dialog-overlay"
+ className={cn(
+ 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in',
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function DialogContent({
+ className,
+ children,
+ showCloseButton = true,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Content> & {
+ showCloseButton?: boolean;
+}) {
+ return (
+ <DialogPortal data-slot="dialog-portal">
+ <DialogOverlay />
+ <DialogPrimitive.Content
+ data-slot="dialog-content"
+ className={cn(
+ 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg',
+ className
+ )}
+ {...props}
+ >
+ {children}
+ {showCloseButton && (
+ <DialogPrimitive.Close
+ data-slot="dialog-close"
+ className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"
+ >
+ <XIcon />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ )}
+ </DialogPrimitive.Content>
+ </DialogPortal>
+ );
+}
+
+function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="dialog-header"
+ className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
+ {...props}
+ />
+ );
+}
+
+function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="dialog-footer"
+ className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
+ {...props}
+ />
+ );
+}
+
+function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
+ return (
+ <DialogPrimitive.Title
+ data-slot="dialog-title"
+ className={cn('font-semibold text-lg leading-none', className)}
+ {...props}
+ />
+ );
+}
+
+function DialogDescription({
+ className,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Description>) {
+ return (
+ <DialogPrimitive.Description
+ data-slot="dialog-description"
+ className={cn('text-muted-foreground text-sm', className)}
+ {...props}
+ />
+ );
+}
+
+export {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogOverlay,
+ DialogPortal,
+ DialogTitle,
+ DialogTrigger,
+};
diff --git a/libs/typescript/playground/src/components/ui/dropdown-menu.tsx b/libs/typescript/playground/src/components/ui/dropdown-menu.tsx
new file mode 100644
index 0000000000..e7da434354
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/dropdown-menu.tsx
@@ -0,0 +1,233 @@
+import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
+import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
+import type * as React from 'react';
+
+import { cn } from '../../utils/cn';
+
+function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
+}
+
+function DropdownMenuPortal({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
+ return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
+}
+
+function DropdownMenuTrigger({
+ className,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
+ return (
+ <DropdownMenuPrimitive.Trigger
+ data-slot="dropdown-menu-trigger"
+ className={className}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuContent({
+ className,
+ sideOffset = 4,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
+ return (
+ <DropdownMenuPrimitive.Portal>
+ <DropdownMenuPrimitive.Content
+ data-slot="dropdown-menu-content"
+ sideOffset={sideOffset}
+ className={cn(
+ 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in',
+ className
+ )}
+ {...props}
+ />
+ </DropdownMenuPrimitive.Portal>
+ );
+}
+
+function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
+ return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
+}
+
+function DropdownMenuItem({
+ className,
+ inset,
+ variant = 'default',
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
+ inset?: boolean;
+ variant?: 'default' | 'destructive';
+}) {
+ return (
+ <DropdownMenuPrimitive.Item
+ data-slot="dropdown-menu-item"
+ data-inset={inset}
+ data-variant={variant}
+ className={cn(
+ "data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuCheckboxItem({
+ className,
+ children,
+ checked,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
+ return (
+ <DropdownMenuPrimitive.CheckboxItem
+ data-slot="dropdown-menu-checkbox-item"
+ className={cn(
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
+ className
+ )}
+ checked={checked}
+ {...props}
+ >
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <CheckIcon className="size-4" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.CheckboxItem>
+ );
+}
+
+function DropdownMenuRadioGroup({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
+ return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
+}
+
+function DropdownMenuRadioItem({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
+ return (
+ <DropdownMenuPrimitive.RadioItem
+ data-slot="dropdown-menu-radio-item"
+ className={cn(
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
+ className
+ )}
+ {...props}
+ >
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <CircleIcon className="size-2 fill-current" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.RadioItem>
+ );
+}
+
+function DropdownMenuLabel({
+ className,
+ inset,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
+ inset?: boolean;
+}) {
+ return (
+ <DropdownMenuPrimitive.Label
+ data-slot="dropdown-menu-label"
+ data-inset={inset}
+ className={cn('px-2 py-1.5 font-medium text-sm data-[inset]:pl-8', className)}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuSeparator({
+ className,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
+ return (
+ <DropdownMenuPrimitive.Separator
+ data-slot="dropdown-menu-separator"
+ className={cn('-mx-1 my-1 h-px bg-border', className)}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
+ return (
+ <span
+ data-slot="dropdown-menu-shortcut"
+ className={cn('ml-auto text-muted-foreground text-xs tracking-widest', className)}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
+}
+
+function DropdownMenuSubTrigger({
+ className,
+ inset,
+ children,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
+ inset?: boolean;
+}) {
+ return (
+ <DropdownMenuPrimitive.SubTrigger
+ data-slot="dropdown-menu-sub-trigger"
+ data-inset={inset}
+ className={cn(
+ 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[inset]:pl-8 data-[state=open]:text-accent-foreground',
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRightIcon className="ml-auto size-4" />
+ </DropdownMenuPrimitive.SubTrigger>
+ );
+}
+
+function DropdownMenuSubContent({
+ className,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
+ return (
+ <DropdownMenuPrimitive.SubContent
+ data-slot="dropdown-menu-sub-content"
+ className={cn(
+ 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in',
+ className
+ )}
+ {...props}
+ />
+ );
+}
+
+export {
+ DropdownMenu,
+ DropdownMenuPortal,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuGroup,
+ DropdownMenuLabel,
+ DropdownMenuItem,
+ DropdownMenuCheckboxItem,
+ DropdownMenuRadioGroup,
+ DropdownMenuRadioItem,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuSub,
+ DropdownMenuSubTrigger,
+ DropdownMenuSubContent,
+};
diff --git a/libs/typescript/playground/src/components/ui/index.ts b/libs/typescript/playground/src/components/ui/index.ts
new file mode 100644
index 0000000000..86942dbbc2
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/index.ts
@@ -0,0 +1,6 @@
+export * from './button';
+export * from './dialog';
+export * from './dropdown-menu';
+export * from './select';
+export * from './skeleton';
+export * from './tooltip';
diff --git a/libs/typescript/playground/src/components/ui/select.tsx b/libs/typescript/playground/src/components/ui/select.tsx
new file mode 100644
index 0000000000..d9f51f41b4
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/select.tsx
@@ -0,0 +1,175 @@
+import * as SelectPrimitive from '@radix-ui/react-select';
+import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
+import type * as React from 'react';
+
+import { cn } from '../../utils/cn';
+
+function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
+ return <SelectPrimitive.Root data-slot="select" {...props} />;
+}
+
+function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />;
+}
+
+function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
+}
+
+function SelectTrigger({
+ className,
+ size = 'default',
+ minimal = false,
+ children,
+ ...props
+}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
+ size?: 'sm' | 'default';
+ minimal?: boolean;
+}) {
+ return (
+ <SelectPrimitive.Trigger
+ data-slot="select-trigger"
+ data-size={size}
+ className={cn(
+ "dark:hover:bg-input/50'size-'])]:size-4 dark:aria-invalid:ring-destructive/40'text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-foreground text-sm outline-none transition-[color,box-shadow] [&_svg:not([class*= [&_svg:not([class*= focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 [&_svg]:pointer-events-none [&_svg]:shrink-0",
+ !minimal && 'shadow-xs',
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <SelectPrimitive.Icon asChild>
+ <ChevronDownIcon className="size-4 opacity-50" />
+ </SelectPrimitive.Icon>
+ </SelectPrimitive.Trigger>
+ );
+}
+
+function SelectContent({
+ className,
+ children,
+ position = 'popper',
+ minimal = false,
+ ...props
+}: React.ComponentProps<typeof SelectPrimitive.Content> & {
+ minimal?: boolean;
+}) {
+ return (
+ <SelectPrimitive.Portal>
+ <SelectPrimitive.Content
+ data-slot="select-content"
+ className={cn(
+ 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md bg-popover text-popover-foreground data-[state=closed]:animate-out data-[state=open]:animate-in',
+ !minimal && 'border shadow-md',
+ position === 'popper' &&
+ 'data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1',
+ className
+ )}
+ position={position}
+ {...props}
+ >
+ <SelectScrollUpButton />
+ <SelectPrimitive.Viewport
+ className={cn(
+ 'p-1',
+ position === 'popper' &&
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1'
+ )}
+ >
+ {children}
+ </SelectPrimitive.Viewport>
+ <SelectScrollDownButton />
+ </SelectPrimitive.Content>
+ </SelectPrimitive.Portal>
+ );
+}
+
+function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
+ return (
+ <SelectPrimitive.Label
+ data-slot="select-label"
+ className={cn('px-2 py-1.5 text-muted-foreground text-xs', className)}
+ {...props}
+ />
+ );
+}
+
+function SelectItem({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<typeof SelectPrimitive.Item>) {
+ return (
+ <SelectPrimitive.Item
+ data-slot="select-item"
+ className={cn(
+ "data-[disabled]:opacity-50'size-'])]:size-4 data-[disabled]:pointer-events-none'text-'])]:text-muted-foreground relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden [&_svg:not([class*= [&_svg:not([class*= focus:bg-accent focus:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute right-2 flex size-3.5 items-center justify-center">
+ <SelectPrimitive.ItemIndicator>
+ <CheckIcon className="size-4" />
+ </SelectPrimitive.ItemIndicator>
+ </span>
+ <SelectPrimitive.ItemText className="truncate">{children}</SelectPrimitive.ItemText>
+ </SelectPrimitive.Item>
+ );
+}
+
+function SelectSeparator({
+ className,
+ ...props
+}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
+ return (
+ <SelectPrimitive.Separator
+ data-slot="select-separator"
+ className={cn('-mx-1 pointer-events-none my-1 h-px bg-border', className)}
+ {...props}
+ />
+ );
+}
+
+function SelectScrollUpButton({
+ className,
+ ...props
+}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
+ return (
+ <SelectPrimitive.ScrollUpButton
+ data-slot="select-scroll-up-button"
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
+ {...props}
+ >
+ <ChevronUpIcon className="size-4" />
+ </SelectPrimitive.ScrollUpButton>
+ );
+}
+
+function SelectScrollDownButton({
+ className,
+ ...props
+}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
+ return (
+ <SelectPrimitive.ScrollDownButton
+ data-slot="select-scroll-down-button"
+ className={cn('flex cursor-default items-center justify-center py-1', className)}
+ {...props}
+ >
+ <ChevronDownIcon className="size-4" />
+ </SelectPrimitive.ScrollDownButton>
+ );
+}
+
+export {
+ Select,
+ SelectContent,
+ SelectGroup,
+ SelectItem,
+ SelectLabel,
+ SelectScrollDownButton,
+ SelectScrollUpButton,
+ SelectSeparator,
+ SelectTrigger,
+ SelectValue,
+};
diff --git a/libs/typescript/playground/src/components/ui/skeleton.tsx b/libs/typescript/playground/src/components/ui/skeleton.tsx
new file mode 100644
index 0000000000..73b5cd3a4c
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/skeleton.tsx
@@ -0,0 +1,14 @@
+import { cn } from '../../utils/cn';
+
+interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {}
+
+function Skeleton({ className, ...props }: SkeletonProps) {
+ return (
+ <div
+ className={cn('animate-pulse rounded-md bg-neutral-200 dark:bg-neutral-700', className)}
+ {...props}
+ />
+ );
+}
+
+export { Skeleton };
diff --git a/libs/typescript/playground/src/components/ui/tooltip.tsx b/libs/typescript/playground/src/components/ui/tooltip.tsx
new file mode 100644
index 0000000000..1a7a633ca5
--- /dev/null
+++ b/libs/typescript/playground/src/components/ui/tooltip.tsx
@@ -0,0 +1,60 @@
+import * as TooltipPrimitive from '@radix-ui/react-tooltip';
+import type * as React from 'react';
+
+import { cn } from '../../utils/cn';
+
+function TooltipProvider({
+ delayDuration = 0,
+ ...props
+}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
+ return (
+ <TooltipPrimitive.Provider
+ data-slot="tooltip-provider"
+ delayDuration={delayDuration}
+ {...props}
+ />
+ );
+}
+
+function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
+ return (
+ <TooltipProvider>
+ <TooltipPrimitive.Root data-slot="tooltip" {...props} />
+ </TooltipProvider>
+ );
+}
+
+function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
+}
+
+function TooltipContent({
+ className,
+ sideOffset = 0,
+ children,
+ hideArrow = false,
+ ...props
+}: React.ComponentProps<typeof TooltipPrimitive.Content> & {
+ hideArrow?: boolean;
+}) {
+ return (
+ <TooltipPrimitive.Portal>
+ <TooltipPrimitive.Content
+ data-slot="tooltip-content"
+ sideOffset={sideOffset}
+ className={cn(
+ 'fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs data-[state=closed]:animate-out',
+ className
+ )}
+ {...props}
+ >
+ {children}
+ {!hideArrow && (
+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary" />
+ )}
+ </TooltipPrimitive.Content>
+ </TooltipPrimitive.Portal>
+ );
+}
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
diff --git a/libs/typescript/playground/src/context/ChatProvider.tsx b/libs/typescript/playground/src/context/ChatProvider.tsx
new file mode 100644
index 0000000000..93acb9c0a4
--- /dev/null
+++ b/libs/typescript/playground/src/context/ChatProvider.tsx
@@ -0,0 +1,183 @@
+// Per-chat context provider
+// Adapted from cloud/src/website/app/contexts/ChatContext.tsx
+
+import { useReducer, useEffect, useRef, type ReactNode } from 'react';
+import {
+ ChatStateContext,
+ ChatDispatchContext,
+ type ChatState,
+ type ChatAction,
+} from './PlaygroundContext';
+import { usePlayground } from '../hooks/usePlayground';
+import { processMessagesForRendering } from '../utils/messageProcessing';
+import type { Chat } from '../types';
+
+// =============================================================================
+// Create Initial State
+// =============================================================================
+
+function createInitialState(chat: Chat): ChatState {
+ return {
+ id: chat.id,
+ name: chat.name,
+ messages: chat.messages || [],
+ model: chat.model,
+ computer: chat.computer,
+ currentInput: '',
+ waitingForResponse: false,
+ chatError: null,
+ processedMessages: processMessagesForRendering(chat.messages || []),
+ retryState: null,
+ };
+}
+
+// =============================================================================
+// Reducer
+// =============================================================================
+
+function chatReducer(state: ChatState, action: ChatAction): ChatState {
+ switch (action.type) {
+ case 'SET_INPUT':
+ return { ...state, currentInput: action.payload };
+
+ case 'SET_MODEL':
+ return { ...state, model: action.payload };
+
+ case 'SET_COMPUTER':
+ return { ...state, computer: action.payload };
+
+ case 'ADD_MESSAGE': {
+ const newMessages = [...state.messages, action.payload];
+ return {
+ ...state,
+ messages: newMessages,
+ processedMessages: processMessagesForRendering(newMessages),
+ };
+ }
+
+ case 'SET_MESSAGES': {
+ return {
+ ...state,
+ messages: action.payload,
+ processedMessages: processMessagesForRendering(action.payload),
+ };
+ }
+
+ case 'APPEND_MESSAGES': {
+ const newMessages = [...state.messages, ...action.payload];
+ return {
+ ...state,
+ messages: newMessages,
+ processedMessages: processMessagesForRendering(newMessages),
+ };
+ }
+
+ case 'SET_WAITING':
+ return { ...state, waitingForResponse: action.payload };
+
+ case 'SET_ERROR':
+ return { ...state, chatError: action.payload };
+
+ case 'SET_RETRY_STATE':
+ return { ...state, retryState: action.payload };
+
+ case 'UPDATE_NAME':
+ return { ...state, name: action.payload };
+
+ case 'CLEAR_INPUT':
+ return { ...state, currentInput: '' };
+
+ case 'RESET_CHAT':
+ return createInitialState(action.payload);
+
+ default:
+ return state;
+ }
+}
+
+// =============================================================================
+// Provider Props
+// =============================================================================
+
+interface ChatProviderProps {
+ chat: Chat;
+ children: ReactNode;
+ isGenerating?: boolean;
+}
+
+// =============================================================================
+// Provider Component
+// =============================================================================
+
+export function ChatProvider({ chat, children, isGenerating = false }: ChatProviderProps) {
+ const [state, dispatch] = useReducer(chatReducer, chat, (c) => ({
+ ...createInitialState(c),
+ waitingForResponse: isGenerating,
+ }));
+
+ const { dispatch: playgroundDispatch } = usePlayground();
+
+ // Reset state when chat changes (different chat selected)
+ useEffect(() => {
+ if (chat.id !== state.id) {
+ dispatch({ type: 'RESET_CHAT', payload: chat });
+ }
+ }, [chat.id, state.id, chat]);
+
+ // Sync model and computer from chat prop when they become available
+ useEffect(() => {
+ if (chat.model && !state.model) {
+ dispatch({ type: 'SET_MODEL', payload: chat.model });
+ }
+ }, [chat.model, state.model]);
+
+ useEffect(() => {
+ if (chat.computer && !state.computer) {
+ dispatch({ type: 'SET_COMPUTER', payload: chat.computer });
+ }
+ }, [chat.computer, state.computer]);
+
+ // Sync messages from global state when they change
+ useEffect(() => {
+ if (chat.id === state.id && chat.messages && chat.messages.length > state.messages.length) {
+ dispatch({ type: 'SET_MESSAGES', payload: chat.messages });
+ }
+ }, [chat.id, chat.messages, state.id, state.messages.length]);
+
+ // Track previous values to avoid unnecessary syncs
+ const prevModelRef = useRef(state.model);
+ const prevComputerRef = useRef(state.computer);
+ const prevNameRef = useRef(state.name);
+
+ // Sync chat metadata back to global store only when values actually change
+ useEffect(() => {
+ const modelChanged = prevModelRef.current !== state.model;
+ const computerChanged = prevComputerRef.current !== state.computer;
+ const nameChanged = prevNameRef.current !== state.name;
+
+ if (modelChanged || computerChanged || nameChanged) {
+ prevModelRef.current = state.model;
+ prevComputerRef.current = state.computer;
+ prevNameRef.current = state.name;
+
+ playgroundDispatch({
+ type: 'UPDATE_CHAT',
+ payload: {
+ id: state.id,
+ updates: {
+ name: state.name,
+ model: state.model,
+ computer: state.computer,
+ updated: new Date(),
+ },
+ },
+ });
+ }
+ }, [state.name, state.model, state.computer, state.id, playgroundDispatch]);
+
+ return (
+ <ChatStateContext.Provider value={state}>
+ <ChatDispatchContext.Provider value={dispatch}>{children}</ChatDispatchContext.Provider>
+ </ChatStateContext.Provider>
+ );
+}
diff --git a/libs/typescript/playground/src/context/PlaygroundContext.tsx b/libs/typescript/playground/src/context/PlaygroundContext.tsx
new file mode 100644
index 0000000000..6505ab6e6c
--- /dev/null
+++ b/libs/typescript/playground/src/context/PlaygroundContext.tsx
@@ -0,0 +1,138 @@
+// Context for playground state management
+// Adapted from cloud/src/website/app/contexts/ChatContext.tsx and cloud/src/website/app/providers/PlaygroundProvider.tsx
+
+import { createContext, type Dispatch } from 'react';
+import type { PlaygroundAdapters, ComputerInfo } from '../adapters/types';
+import type {
+ Chat,
+ Model,
+ ModelProvider,
+ AgentMessage,
+ ChatError,
+ ProcessedMessage,
+ RetryState,
+ Computer,
+} from '../types';
+
+// =============================================================================
+// Playground State
+// =============================================================================
+
+/**
+ * Global playground state.
+ * Manages chats, computers, models, and UI state.
+ */
+export interface PlaygroundState {
+ // Chats
+ chats: Chat[];
+ activeChatId: string | null;
+
+ // Computers
+ computers: ComputerInfo[];
+ currentComputerId: string | null;
+
+ // Models
+ availableModels: ModelProvider[];
+ selectedModel: string | null;
+
+ // Loading & Error
+ isLoading: boolean;
+ error: string | null;
+
+ // Generation state (tracks which chats have active agent requests)
+ generatingChatIds: Set<string>;
+ requestStartTimes: Map<string, number>;
+ lastRequestDurations: Map<string, number>;
+
+ // UI state
+ initialized: boolean;
+ showSettings: boolean;
+ isSidebarCollapsed: boolean;
+}
+
+// =============================================================================
+// Chat State (per-chat context)
+// =============================================================================
+
+/**
+ * Per-chat state for the active chat.
+ * Manages input, messages, and chat-specific UI state.
+ */
+export interface ChatState {
+ id: string;
+ name: string;
+ messages: AgentMessage[];
+ model?: Model;
+ computer?: Computer;
+ currentInput: string;
+ waitingForResponse: boolean;
+ chatError: ChatError | null;
+ processedMessages: ProcessedMessage[];
+ retryState: RetryState | null;
+}
+
+// =============================================================================
+// Action Types
+// =============================================================================
+
+export type PlaygroundAction =
+ // Chat actions
+ | { type: 'SET_CHATS'; payload: Chat[] }
+ | { type: 'ADD_CHAT'; payload: Chat }
+ | { type: 'UPDATE_CHAT'; payload: { id: string; updates: Partial<Chat> } }
+ | { type: 'DELETE_CHAT'; payload: string }
+ | { type: 'SET_ACTIVE_CHAT_ID'; payload: string | null }
+ | { type: 'SET_CHAT_MESSAGES'; payload: { id: string; messages: AgentMessage[] } }
+ // Computer actions
+ | { type: 'SET_COMPUTERS'; payload: ComputerInfo[] }
+ | { type: 'SET_CURRENT_COMPUTER'; payload: string | null }
+ // Model actions
+ | { type: 'SET_MODELS'; payload: ModelProvider[] }
+ | { type: 'SET_SELECTED_MODEL'; payload: string }
+ // Loading & Error actions
+ | { type: 'SET_LOADING'; payload: boolean }
+ | { type: 'SET_ERROR'; payload: string | null }
+ // Generation state actions
+ | { type: 'SET_CHAT_GENERATING'; payload: { chatId: string; generating: boolean } }
+ | { type: 'RESET_REQUEST_START_TIME'; payload: { chatId: string } }
+ // UI state actions
+ | { type: 'SET_INITIALIZED'; payload: boolean }
+ | { type: 'SET_SHOW_SETTINGS'; payload: boolean }
+ | { type: 'TOGGLE_SIDEBAR' };
+
+export type ChatAction =
+ | { type: 'SET_INPUT'; payload: string }
+ | { type: 'SET_MODEL'; payload: Model }
+ | { type: 'SET_COMPUTER'; payload: Computer }
+ | { type: 'ADD_MESSAGE'; payload: AgentMessage }
+ | { type: 'SET_MESSAGES'; payload: AgentMessage[] }
+ | { type: 'APPEND_MESSAGES'; payload: AgentMessage[] }
+ | { type: 'SET_WAITING'; payload: boolean }
+ | { type: 'SET_ERROR'; payload: ChatError | null }
+ | { type: 'SET_RETRY_STATE'; payload: RetryState | null }
+ | { type: 'UPDATE_NAME'; payload: string }
+ | { type: 'CLEAR_INPUT' }
+ | { type: 'RESET_CHAT'; payload: Chat };
+
+// =============================================================================
+// Context Values
+// =============================================================================
+
+export interface PlaygroundContextValue {
+ adapters: PlaygroundAdapters;
+ state: PlaygroundState;
+ dispatch: Dispatch<PlaygroundAction>;
+}
+
+export interface ChatContextValue {
+ state: ChatState;
+ dispatch: Dispatch<ChatAction>;
+}
+
+// =============================================================================
+// Contexts
+// =============================================================================
+
+export const PlaygroundContext = createContext<PlaygroundContextValue | null>(null);
+export const ChatStateContext = createContext<ChatState | null>(null);
+export const ChatDispatchContext = createContext<Dispatch<ChatAction> | null>(null);
diff --git a/libs/typescript/playground/src/context/PlaygroundProvider.tsx b/libs/typescript/playground/src/context/PlaygroundProvider.tsx
new file mode 100644
index 0000000000..7bc0674bc3
--- /dev/null
+++ b/libs/typescript/playground/src/context/PlaygroundProvider.tsx
@@ -0,0 +1,213 @@
+// Provider for playground state management
+// Adapted from cloud/src/website/app/providers/PlaygroundProvider.tsx
+
+import { useReducer, useEffect, useMemo, type ReactNode } from 'react';
+import {
+ PlaygroundContext,
+ type PlaygroundState,
+ type PlaygroundAction,
+} from './PlaygroundContext';
+import type { PlaygroundAdapters } from '../adapters/types';
+import type { Chat } from '../types';
+
+// =============================================================================
+// Initial State
+// =============================================================================
+
+const initialState: PlaygroundState = {
+ chats: [],
+ activeChatId: null,
+ computers: [],
+ currentComputerId: null,
+ availableModels: [],
+ selectedModel: null,
+ isLoading: true,
+ error: null,
+ generatingChatIds: new Set(),
+ requestStartTimes: new Map(),
+ lastRequestDurations: new Map(),
+ initialized: false,
+ showSettings: false,
+ isSidebarCollapsed: false,
+};
+
+// =============================================================================
+// Reducer
+// =============================================================================
+
+function playgroundReducer(state: PlaygroundState, action: PlaygroundAction): PlaygroundState {
+ switch (action.type) {
+ case 'SET_CHATS':
+ return { ...state, chats: action.payload };
+
+ case 'ADD_CHAT':
+ return { ...state, chats: [...state.chats, action.payload] };
+
+ case 'UPDATE_CHAT': {
+ const updatedChats = state.chats.map((chat) =>
+ chat.id === action.payload.id ? { ...chat, ...action.payload.updates } : chat
+ );
+ return { ...state, chats: updatedChats };
+ }
+
+ case 'DELETE_CHAT': {
+ const filteredChats = state.chats.filter((c) => c.id !== action.payload);
+ const newActiveChatId =
+ state.activeChatId === action.payload
+ ? filteredChats.length > 0
+ ? [...filteredChats].sort((a, b) => b.updated.getTime() - a.updated.getTime())[0].id
+ : null
+ : state.activeChatId;
+ return {
+ ...state,
+ chats: filteredChats,
+ activeChatId: newActiveChatId,
+ };
+ }
+
+ case 'SET_ACTIVE_CHAT_ID':
+ return { ...state, activeChatId: action.payload };
+
+ case 'SET_CHAT_MESSAGES': {
+ const updatedChats = state.chats.map((chat) =>
+ chat.id === action.payload.id ? { ...chat, messages: action.payload.messages } : chat
+ );
+ return { ...state, chats: updatedChats };
+ }
+
+ case 'SET_COMPUTERS':
+ return { ...state, computers: action.payload };
+
+ case 'SET_CURRENT_COMPUTER':
+ return { ...state, currentComputerId: action.payload };
+
+ case 'SET_MODELS':
+ return { ...state, availableModels: action.payload };
+
+ case 'SET_SELECTED_MODEL':
+ return { ...state, selectedModel: action.payload };
+
+ case 'SET_LOADING':
+ return { ...state, isLoading: action.payload };
+
+ case 'SET_ERROR':
+ return { ...state, error: action.payload };
+
+ case 'SET_CHAT_GENERATING': {
+ const newGeneratingChatIds = new Set(state.generatingChatIds);
+ const newRequestStartTimes = new Map(state.requestStartTimes);
+ const newLastRequestDurations = new Map(state.lastRequestDurations);
+
+ if (action.payload.generating) {
+ newGeneratingChatIds.add(action.payload.chatId);
+ newRequestStartTimes.set(action.payload.chatId, Date.now());
+ } else {
+ newGeneratingChatIds.delete(action.payload.chatId);
+ const startTime = newRequestStartTimes.get(action.payload.chatId);
+ if (startTime) {
+ const durationSeconds = (Date.now() - startTime) / 1000;
+ newLastRequestDurations.set(action.payload.chatId, durationSeconds);
+ }
+ newRequestStartTimes.delete(action.payload.chatId);
+ }
+
+ return {
+ ...state,
+ generatingChatIds: newGeneratingChatIds,
+ requestStartTimes: newRequestStartTimes,
+ lastRequestDurations: newLastRequestDurations,
+ };
+ }
+
+ case 'RESET_REQUEST_START_TIME': {
+ const newRequestStartTimes = new Map(state.requestStartTimes);
+ newRequestStartTimes.set(action.payload.chatId, Date.now());
+ return {
+ ...state,
+ requestStartTimes: newRequestStartTimes,
+ };
+ }
+
+ case 'SET_INITIALIZED':
+ return { ...state, initialized: action.payload };
+
+ case 'SET_SHOW_SETTINGS':
+ return { ...state, showSettings: action.payload };
+
+ case 'TOGGLE_SIDEBAR':
+ return { ...state, isSidebarCollapsed: !state.isSidebarCollapsed };
+
+ default:
+ return state;
+ }
+}
+
+// =============================================================================
+// Provider Props
+// =============================================================================
+
+interface PlaygroundProviderProps {
+ adapters: PlaygroundAdapters;
+ children: ReactNode;
+ /** Optional initial chats (for SSR or pre-loading) */
+ initialChats?: Chat[];
+}
+
+// =============================================================================
+// Provider Component
+// =============================================================================
+
+export function PlaygroundProvider({ adapters, children, initialChats }: PlaygroundProviderProps) {
+ const [state, dispatch] = useReducer(playgroundReducer, {
+ ...initialState,
+ chats: initialChats || [],
+ });
+
+ // Initialize from adapters
+ useEffect(() => {
+ async function initialize() {
+ try {
+ const [chats, computers, models] = await Promise.all([
+ initialChats ? Promise.resolve(initialChats) : adapters.persistence.loadChats(),
+ adapters.computer.listComputers(),
+ adapters.inference.getAvailableModels(),
+ ]);
+
+ dispatch({ type: 'SET_CHATS', payload: chats });
+ dispatch({ type: 'SET_COMPUTERS', payload: computers });
+ dispatch({ type: 'SET_MODELS', payload: models });
+
+ // Set defaults
+ if (computers.length > 0) {
+ dispatch({ type: 'SET_CURRENT_COMPUTER', payload: computers[0].id });
+ }
+ if (models.length > 0 && models[0].models.length > 0) {
+ dispatch({ type: 'SET_SELECTED_MODEL', payload: models[0].models[0].id });
+ }
+
+ dispatch({ type: 'SET_LOADING', payload: false });
+ dispatch({ type: 'SET_INITIALIZED', payload: true });
+ } catch (error) {
+ dispatch({
+ type: 'SET_ERROR',
+ payload: error instanceof Error ? error.message : 'Failed to initialize',
+ });
+ dispatch({ type: 'SET_LOADING', payload: false });
+ }
+ }
+
+ initialize();
+ }, [adapters, initialChats]);
+
+ // Memoize context value to prevent unnecessary re-renders
+ const contextValue = useMemo(
+ () => ({
+ adapters,
+ state,
+ dispatch,
+ }),
+ [adapters, state]
+ );
+
+ return <PlaygroundContext.Provider value={contextValue}>{children}</PlaygroundContext.Provider>;
+}
diff --git a/libs/typescript/playground/src/context/index.ts b/libs/typescript/playground/src/context/index.ts
new file mode 100644
index 0000000000..65c8c2ecf2
--- /dev/null
+++ b/libs/typescript/playground/src/context/index.ts
@@ -0,0 +1,15 @@
+// Barrel export for context
+export {
+ PlaygroundContext,
+ ChatStateContext,
+ ChatDispatchContext,
+ type PlaygroundContextValue,
+ type ChatContextValue,
+ type PlaygroundState,
+ type ChatState,
+ type PlaygroundAction,
+ type ChatAction,
+} from './PlaygroundContext';
+
+export { PlaygroundProvider } from './PlaygroundProvider';
+export { ChatProvider } from './ChatProvider';
diff --git a/libs/typescript/playground/src/hooks/index.ts b/libs/typescript/playground/src/hooks/index.ts
new file mode 100644
index 0000000000..6c24db7368
--- /dev/null
+++ b/libs/typescript/playground/src/hooks/index.ts
@@ -0,0 +1,13 @@
+// Barrel export for hooks
+export {
+ usePlayground,
+ useChat,
+ useChatDispatch,
+ useActiveChat,
+ useIsChatGenerating,
+ useLastRequestDuration,
+ useRequestStartTime,
+ useFindDefaultModel,
+} from './usePlayground';
+
+export { useAgentRequest } from './useAgentRequest';
diff --git a/libs/typescript/playground/src/hooks/useAgentRequest.ts b/libs/typescript/playground/src/hooks/useAgentRequest.ts
new file mode 100644
index 0000000000..588754f926
--- /dev/null
+++ b/libs/typescript/playground/src/hooks/useAgentRequest.ts
@@ -0,0 +1,533 @@
+// Hook for making agent requests
+// Adapted from cloud/src/website/app/hooks/playground/useAgentRequest.ts
+
+import { useEffect, useRef, useCallback } from 'react';
+import { usePlayground, useChat, useChatDispatch } from './usePlayground';
+import { usePlaygroundTelemetry } from '../telemetry';
+import type { AgentMessage, UserMessage } from '../types';
+import { isVM, isCustomComputer } from '../types';
+
+// Agent client interface for making requests
+interface AgentClientOptions {
+ timeout?: number;
+ retries?: number;
+ signal?: AbortSignal;
+ apiKey?: string;
+ onRetry?: (attempt: number, maxRetries: number) => void;
+}
+
+interface AgentResponse {
+ status?: string;
+ error?: string;
+ output?: AgentMessage[];
+}
+
+/**
+ * Simple agent client for making requests to the computer server.
+ */
+class AgentClient {
+ constructor(
+ private baseUrl: string,
+ private options: AgentClientOptions & { env?: Record<string, string> } = {}
+ ) {}
+
+ async health(): Promise<{ status: 'ok' | 'unreachable' }> {
+ try {
+ // Try /cmd endpoint (cloud sandboxes use this for health checks)
+ await fetch(`${this.baseUrl}/cmd`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ command: 'version', params: {} }),
+ signal: this.options.signal || AbortSignal.timeout(5000),
+ });
+ // Consider server reachable if we get any response (even 4xx means server is up)
+ return { status: 'ok' };
+ } catch {
+ return { status: 'unreachable' };
+ }
+ }
+
+ responses = {
+ create: async (params: {
+ model: string;
+ input: (UserMessage | AgentMessage)[];
+ agent_kwargs?: Record<string, unknown>;
+ env?: Record<string, string>;
+ }): Promise<AgentResponse> => {
+ const { timeout = 120000, retries = 3, signal, onRetry } = this.options;
+
+ let lastError: Error | null = null;
+
+ for (let attempt = 0; attempt <= retries; attempt++) {
+ try {
+ if (attempt > 0) {
+ onRetry?.(attempt, retries);
+ }
+
+ const headers: Record<string, string> = {
+ 'Content-Type': 'application/json',
+ };
+ if (this.options.apiKey) {
+ headers['X-API-Key'] = this.options.apiKey;
+ }
+
+ const response = await fetch(`${this.baseUrl}/responses`, {
+ method: 'POST',
+ headers,
+ body: JSON.stringify({
+ model: params.model,
+ input: params.input,
+ agent_kwargs: params.agent_kwargs,
+ env: { ...this.options.env, ...params.env },
+ }),
+ signal: signal || AbortSignal.timeout(timeout),
+ });
+
+ if (!response.ok) {
+ throw new Error(`Request failed: ${response.status}`);
+ }
+
+ return await response.json();
+ } catch (error) {
+ lastError = error instanceof Error ? error : new Error(String(error));
+ if (signal?.aborted) throw lastError;
+ }
+ }
+
+ throw lastError || new Error('Request failed');
+ },
+ };
+}
+
+/**
+ * Hook for making agent requests.
+ * Handles the agent loop, abort handling, and retry logic.
+ *
+ * @returns Object with sendMessage, stopResponse, and retry handlers
+ */
+export function useAgentRequest() {
+ const { adapters, state, dispatch: playgroundDispatch } = usePlayground();
+ const chatState = useChat();
+ const chatDispatch = useChatDispatch();
+ const {
+ trackMessageSent,
+ trackTrajectoryCompleted,
+ trackTrajectoryFailed,
+ trackTrajectoryStopped,
+ } = usePlaygroundTelemetry();
+
+ const shouldStopResponseRef = useRef(false);
+ const abortReasonRef = useRef<'manual' | 'timeout' | null>(null);
+ const currentRequestRef = useRef<{
+ chatId: string;
+ messages: (UserMessage | AgentMessage)[];
+ abortController?: AbortController;
+ startTime?: number;
+ iterationCount?: number;
+ } | null>(null);
+
+ // Keep a ref to the latest chat state to avoid stale closure issues
+ const chatStateRef = useRef(chatState);
+ useEffect(() => {
+ chatStateRef.current = chatState;
+ });
+
+ // Helper to set generating state globally
+ const setGlobalGenerating = useCallback(
+ (chatId: string, generating: boolean) => {
+ playgroundDispatch({
+ type: 'SET_CHAT_GENERATING',
+ payload: { chatId, generating },
+ });
+ },
+ [playgroundDispatch]
+ );
+
+ // Helper to update messages in BOTH local and global state
+ const setMessages = useCallback(
+ (chatId: string, messages: (UserMessage | AgentMessage)[]) => {
+ chatDispatch({ type: 'SET_MESSAGES', payload: messages as AgentMessage[] });
+ playgroundDispatch({
+ type: 'SET_CHAT_MESSAGES',
+ payload: { id: chatId, messages: messages as AgentMessage[] },
+ });
+ },
+ [chatDispatch, playgroundDispatch]
+ );
+
+ // Persist messages via adapter
+ const persistMessages = useCallback(
+ async (chatId: string, messages: (UserMessage | AgentMessage)[]) => {
+ try {
+ await adapters.persistence.saveMessages(chatId, messages as AgentMessage[]);
+ } catch (error) {
+ console.error('Failed to persist messages:', error);
+ }
+ },
+ [adapters.persistence]
+ );
+
+ // Persist title via adapter
+ const persistTitle = useCallback(
+ async (chatId: string, title: string) => {
+ try {
+ const chat = state.chats.find((c) => c.id === chatId);
+ if (chat) {
+ await adapters.persistence.saveChat({ ...chat, name: title });
+ }
+ } catch (error) {
+ console.error('Failed to persist title:', error);
+ }
+ },
+ [adapters.persistence, state.chats]
+ );
+
+ const sendAgentRequest = useCallback(
+ async (messages: (UserMessage | AgentMessage)[], abortController: AbortController) => {
+ const { model, computer } = chatState;
+
+ if (!model || !computer) {
+ return;
+ }
+
+ // Reset request start time for each iteration
+ const chatId = currentRequestRef.current?.chatId;
+ if (chatId) {
+ playgroundDispatch({
+ type: 'RESET_REQUEST_START_TIME',
+ payload: { chatId },
+ });
+ }
+
+ // Clear retry state
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+
+ try {
+ // Get computer URL - this is the sandbox/agent server URL
+ let hostName = '';
+ if (isVM(computer)) {
+ // For VMs, extract hostname from vncUrl or use host property
+ hostName =
+ (computer as { host?: string }).host ||
+ computer.vncUrl?.replace(/^https?:\/\//, '').split(/[:/]/)[0] ||
+ '';
+ } else if (isCustomComputer(computer)) {
+ hostName = computer.url.replace(/^https?:\/\//, '').split(/[:/]/)[0] || '';
+ }
+
+ // Build computer server URL (sandbox agent)
+ // Use http for localhost, https otherwise
+ const protocol = hostName === 'localhost' || hostName === '127.0.0.1' ? 'http' : 'https';
+ const port = '8443';
+ const computerServerUrl = `${protocol}://${hostName}:${port}`;
+
+ // Get inference config from adapter (for env vars like CUA_BASE_URL)
+ const currentComputer = state.computers.find((c) => c.id === state.currentComputerId);
+ const inferenceConfig = currentComputer
+ ? await adapters.inference.getConfig(currentComputer)
+ : { baseUrl: '', env: {} };
+
+ // Build environment variables for the agent
+ // The inference API URL goes in env, not as the agent server URL
+ const env: Record<string, string> = { ...inferenceConfig.env };
+ if (inferenceConfig.baseUrl) {
+ env.CUA_BASE_URL = inferenceConfig.baseUrl;
+ }
+ if (inferenceConfig.apiKey) {
+ env.CUA_API_KEY = inferenceConfig.apiKey;
+ }
+
+ const agentClient = new AgentClient(computerServerUrl, {
+ apiKey: inferenceConfig.apiKey,
+ timeout: 120000,
+ retries: 3,
+ signal: abortController.signal,
+ env,
+ onRetry: (attempt, maxRetries) => {
+ chatDispatch({
+ type: 'SET_RETRY_STATE',
+ payload: { attempt, maxRetries },
+ });
+ },
+ });
+
+ if (shouldStopResponseRef.current) {
+ const chatId = currentRequestRef.current?.chatId;
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+ currentRequestRef.current = null;
+ return;
+ }
+
+ // Handle backward compatibility: add "cua/" prefix if not already present
+ let modelId = model.id;
+ if (!modelId.startsWith('cua/')) {
+ modelId = `cua/${modelId}`;
+ }
+
+ const res = await agentClient.responses.create({
+ model: modelId,
+ input: messages,
+ agent_kwargs: {
+ use_prompt_caching: false,
+ only_n_most_recent_images: 3,
+ },
+ env,
+ });
+
+ if (shouldStopResponseRef.current) {
+ const chatId = currentRequestRef.current?.chatId;
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+ currentRequestRef.current = null;
+ return;
+ }
+
+ // Increment iteration count
+ if (currentRequestRef.current) {
+ currentRequestRef.current.iterationCount =
+ (currentRequestRef.current.iterationCount || 0) + 1;
+ }
+
+ // Check if response failed
+ if (res?.status === 'failed' && res?.error) {
+ trackTrajectoryFailed({ model, errorType: 'agent_error' });
+ const chatId = currentRequestRef.current?.chatId;
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+ currentRequestRef.current = null;
+ chatDispatch({
+ type: 'SET_ERROR',
+ payload: { message: res.error, timestamp: new Date() },
+ });
+ return;
+ }
+
+ let isRunning = true;
+ if (res?.output && res.output.at(-1)?.type === 'message') {
+ isRunning = false;
+ }
+
+ if (res?.output) {
+ const newMessages = [...messages, ...res.output];
+ const chatId = currentRequestRef.current?.chatId;
+
+ if (currentRequestRef.current) {
+ currentRequestRef.current.messages = newMessages;
+ }
+
+ // Update both local and global state
+ if (chatId) {
+ setMessages(chatId, newMessages);
+ persistMessages(chatId, newMessages);
+ }
+
+ if (isRunning && !shouldStopResponseRef.current) {
+ // Continue the conversation
+ await sendAgentRequest(newMessages, abortController);
+ } else {
+ // Completed
+ const chatId = currentRequestRef.current?.chatId;
+ const iterationCount = currentRequestRef.current?.iterationCount || 0;
+ const startTime = currentRequestRef.current?.startTime || Date.now();
+ const durationMs = Date.now() - startTime;
+
+ // Track trajectory completion
+ trackTrajectoryCompleted({
+ model,
+ iterationCount,
+ durationMs,
+ });
+
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+ currentRequestRef.current = null;
+ }
+ } else {
+ const chatId = currentRequestRef.current?.chatId;
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+ currentRequestRef.current = null;
+ }
+ } catch (error) {
+ console.error('Agent request error:', error);
+ const chatId = currentRequestRef.current?.chatId;
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+
+ const wasAborted =
+ error instanceof Error &&
+ (error.message.includes('aborted') || error.name === 'AbortError');
+
+ if (wasAborted && abortReasonRef.current === 'manual') {
+ trackTrajectoryStopped({ model });
+ abortReasonRef.current = null;
+ currentRequestRef.current = null;
+ return;
+ }
+
+ let errorMessage = 'Unknown error';
+ if (error instanceof Error) {
+ if (wasAborted && abortReasonRef.current === 'timeout') {
+ errorMessage = 'Request timed out.';
+ } else if (wasAborted) {
+ abortReasonRef.current = null;
+ currentRequestRef.current = null;
+ return;
+ } else {
+ errorMessage = error.message;
+ }
+ }
+
+ trackTrajectoryFailed({ model, errorType: errorMessage });
+ abortReasonRef.current = null;
+ currentRequestRef.current = null;
+ chatDispatch({
+ type: 'SET_ERROR',
+ payload: { message: errorMessage, timestamp: new Date() },
+ });
+ }
+ },
+ [
+ chatState,
+ state.computers,
+ state.currentComputerId,
+ adapters.inference,
+ chatDispatch,
+ playgroundDispatch,
+ setGlobalGenerating,
+ setMessages,
+ persistMessages,
+ trackTrajectoryCompleted,
+ trackTrajectoryFailed,
+ trackTrajectoryStopped,
+ ]
+ );
+
+ const handleSendMessage = useCallback(async () => {
+ const latestState = chatStateRef.current;
+ const { currentInput, model, computer, messages, id: chatId } = latestState;
+
+ if (!currentInput.trim()) return;
+ if (!model) {
+ console.warn('Please select a model.');
+ return;
+ }
+ if (!computer) {
+ console.warn('Please select a computer.');
+ return;
+ }
+
+ shouldStopResponseRef.current = false;
+ chatDispatch({ type: 'SET_ERROR', payload: null });
+
+ const userMessage: UserMessage = {
+ content: currentInput,
+ role: 'user',
+ type: 'message',
+ };
+
+ const updatedMessages = [...(messages || []), userMessage];
+
+ // Update chat name if first message
+ if ((messages?.length || 0) === 0) {
+ const base = currentInput.trim().replace(/\s+/g, ' ');
+ const maxLen = 60;
+ const newName = base.length > maxLen ? `${base.slice(0, maxLen)}…` : base || 'New Chat';
+ chatDispatch({ type: 'UPDATE_NAME', payload: newName });
+ persistTitle(chatId, newName);
+ }
+
+ // Add user message and clear input
+ setMessages(chatId, updatedMessages);
+ chatDispatch({ type: 'CLEAR_INPUT' });
+ persistMessages(chatId, updatedMessages);
+
+ const abortController = new AbortController();
+ currentRequestRef.current = {
+ chatId,
+ messages: updatedMessages,
+ abortController,
+ startTime: Date.now(),
+ iterationCount: 0,
+ };
+
+ setGlobalGenerating(chatId, true);
+ chatDispatch({ type: 'SET_WAITING', payload: true });
+
+ // Track message sent for telemetry
+ const isFirstMessage = (messages?.length || 0) === 0;
+ trackMessageSent({
+ model,
+ isFirstMessage,
+ sandboxType: isVM(computer) ? 'vm' : 'custom',
+ message: currentInput,
+ });
+
+ await sendAgentRequest(updatedMessages, abortController);
+ }, [
+ chatDispatch,
+ setMessages,
+ setGlobalGenerating,
+ persistMessages,
+ persistTitle,
+ sendAgentRequest,
+ trackMessageSent,
+ ]);
+
+ const handleStopResponse = useCallback(() => {
+ shouldStopResponseRef.current = true;
+ abortReasonRef.current = 'manual';
+ const chatId = currentRequestRef.current?.chatId;
+ if (currentRequestRef.current?.abortController) {
+ currentRequestRef.current.abortController.abort();
+ }
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ chatDispatch({ type: 'SET_RETRY_STATE', payload: null });
+ currentRequestRef.current = null;
+ }, [chatDispatch, setGlobalGenerating]);
+
+ const handleTimeout = useCallback(() => {
+ shouldStopResponseRef.current = true;
+ abortReasonRef.current = 'timeout';
+ const chatId = currentRequestRef.current?.chatId;
+ if (currentRequestRef.current?.abortController) {
+ currentRequestRef.current.abortController.abort();
+ }
+ if (chatId) setGlobalGenerating(chatId, false);
+ chatDispatch({ type: 'SET_WAITING', payload: false });
+ currentRequestRef.current = null;
+ }, [chatDispatch, setGlobalGenerating]);
+
+ const handleRetry = useCallback(async () => {
+ const latestState = chatStateRef.current;
+ const { messages, id: chatId } = latestState;
+
+ if (!messages || messages.length === 0) return;
+
+ const abortController = new AbortController();
+ currentRequestRef.current = {
+ chatId,
+ messages,
+ abortController,
+ };
+
+ setGlobalGenerating(chatId, true);
+ chatDispatch({ type: 'SET_WAITING', payload: true });
+ await sendAgentRequest(messages, abortController);
+ }, [chatDispatch, setGlobalGenerating, sendAgentRequest]);
+
+ return {
+ handleSendMessage,
+ handleStopResponse,
+ handleTimeout,
+ handleRetry,
+ };
+}
diff --git a/libs/typescript/playground/src/hooks/usePlayground.ts b/libs/typescript/playground/src/hooks/usePlayground.ts
new file mode 100644
index 0000000000..3f20077851
--- /dev/null
+++ b/libs/typescript/playground/src/hooks/usePlayground.ts
@@ -0,0 +1,117 @@
+// Hook to access playground context
+// Provides access to adapters, state, and dispatch
+
+import { useContext, type Dispatch } from 'react';
+import {
+ PlaygroundContext,
+ ChatStateContext,
+ ChatDispatchContext,
+ type PlaygroundContextValue,
+ type ChatState,
+ type ChatAction,
+} from '../context/PlaygroundContext';
+
+/**
+ * Hook to access the playground context.
+ * Must be used within a PlaygroundProvider.
+ *
+ * @returns PlaygroundContextValue with adapters, state, and dispatch
+ *
+ * @example
+ * ```tsx
+ * function MyComponent() {
+ * const { adapters, state, dispatch } = usePlayground();
+ * // ...
+ * }
+ * ```
+ */
+export function usePlayground(): PlaygroundContextValue {
+ const context = useContext(PlaygroundContext);
+ if (!context) {
+ throw new Error('usePlayground must be used within a PlaygroundProvider');
+ }
+ return context;
+}
+
+/**
+ * Hook to access the chat state.
+ * Must be used within a ChatProvider.
+ */
+export function useChat(): ChatState {
+ const context = useContext(ChatStateContext);
+ if (!context) {
+ throw new Error('useChat must be used within a ChatProvider');
+ }
+ return context;
+}
+
+/**
+ * Hook to access the chat dispatch.
+ * Must be used within a ChatProvider.
+ */
+export function useChatDispatch(): Dispatch<ChatAction> {
+ const context = useContext(ChatDispatchContext);
+ if (!context) {
+ throw new Error('useChatDispatch must be used within a ChatProvider');
+ }
+ return context;
+}
+
+/**
+ * Hook to get the active chat from state.
+ */
+export function useActiveChat() {
+ const { state } = usePlayground();
+ if (!state.activeChatId) return null;
+ return state.chats.find((c) => c.id === state.activeChatId) ?? null;
+}
+
+/**
+ * Hook to check if a chat is currently generating.
+ */
+export function useIsChatGenerating(chatId: string | null): boolean {
+ const { state } = usePlayground();
+ if (!chatId) return false;
+ return state.generatingChatIds.has(chatId);
+}
+
+/**
+ * Hook to get the last request duration for a chat.
+ */
+export function useLastRequestDuration(chatId: string | null): number | null {
+ const { state } = usePlayground();
+ if (!chatId) return null;
+ return state.lastRequestDurations.get(chatId) ?? null;
+}
+
+/**
+ * Hook to get the request start time for a chat.
+ */
+export function useRequestStartTime(chatId: string | null): number | null {
+ const { state } = usePlayground();
+ if (!chatId) return null;
+ return state.requestStartTimes.get(chatId) ?? null;
+}
+
+/**
+ * Hook to find the default model from available models.
+ */
+export function useFindDefaultModel() {
+ const { state } = usePlayground();
+ const { availableModels, selectedModel } = state;
+
+ // Try selected model first
+ if (selectedModel) {
+ for (const provider of availableModels) {
+ const model = provider.models.find((m) => m.id === selectedModel);
+ if (model) return model;
+ }
+ }
+
+ // Fall back to first available model
+ if (availableModels.length > 0 && availableModels[0].models.length > 0) {
+ return availableModels[0].models[0];
+ }
+
+ return undefined;
+}
diff --git a/libs/typescript/playground/src/index.ts b/libs/typescript/playground/src/index.ts
new file mode 100644
index 0000000000..11775b0107
--- /dev/null
+++ b/libs/typescript/playground/src/index.ts
@@ -0,0 +1,100 @@
+// =============================================================================
+// @trycua/playground
+// =============================================================================
+// Reusable playground UI for Cua computer-use agents.
+// Supports both local (localStorage + user-provided URLs) and cloud (CUA API) usage.
+
+// Types
+export * from './types';
+export * from './adapters/types';
+
+// Adapters
+export { createLocalAdapter } from './adapters/local';
+export { createCloudAdapter } from './adapters/cloud';
+
+// Utilities
+export * from './utils';
+
+// Context & Providers
+export {
+ PlaygroundContext,
+ ChatStateContext,
+ ChatDispatchContext,
+ type PlaygroundContextValue,
+ type ChatContextValue,
+ type PlaygroundState,
+ type ChatState,
+ type PlaygroundAction,
+ type ChatAction,
+} from './context/PlaygroundContext';
+export { PlaygroundProvider } from './context/PlaygroundProvider';
+export { ChatProvider } from './context/ChatProvider';
+
+// Hooks
+export {
+ usePlayground,
+ useChat,
+ useChatDispatch,
+ useActiveChat,
+ useIsChatGenerating,
+ useLastRequestDuration,
+ useRequestStartTime,
+ useFindDefaultModel,
+} from './hooks/usePlayground';
+export { useAgentRequest } from './hooks/useAgentRequest';
+
+// Primitive Components
+export {
+ ChatMessage,
+ getActionDescription,
+ ChatInput,
+ ToolCallsGroup,
+ VNCViewer,
+ ThinkingIndicator,
+ ThinkingCompleteAnimation,
+ ScrambledText,
+ CountdownTimer,
+ DeferredChatsLoader,
+ VMStatusBanner,
+ VNCOverlayPanel,
+} from './components/primitives';
+export type {
+ VNCViewerProps,
+ VMStatusBannerProps,
+ VMVersionInfo,
+ VNCOverlayPanelProps,
+} from './components/primitives';
+export { default as VNCIframe } from './components/primitives/VNCIframe';
+
+// Composed Components
+export { ChatPanel } from './components/composed/ChatPanel';
+export { ChatList } from './components/composed/ChatList';
+export { ChatArea } from './components/composed/ChatArea';
+export { ChatContent } from './components/composed/ChatContent';
+export { ChatSidebar } from './components/composed/ChatSidebar';
+export { ChatSidebarSkeleton } from './components/composed/ChatSidebarSkeleton';
+export { ComputerList } from './components/composed/ComputerList';
+export { EmptyStateWithInput } from './components/composed/EmptyState';
+export { ExamplePrompts, EXAMPLE_PROMPTS } from './components/composed/ExamplePrompts';
+export type { ExamplePrompt } from './components/composed/ExamplePrompts';
+export { PlaygroundLayout } from './components/composed/PlaygroundLayout';
+export { PlaygroundContent } from './components/composed/PlaygroundContent';
+
+// Modals
+export { SettingsModal } from './components/modals/SettingsModal';
+export { CustomComputerModal } from './components/modals/CustomComputerModal';
+export { ExportTrajectoryModal } from './components/modals';
+export { ReplayTrajectoryModal } from './components/modals';
+
+// Trajectory Viewer
+export { default as TrajectoryViewer } from './components/TrajectoryViewer';
+
+// Telemetry
+export { TelemetryProvider, usePlaygroundTelemetry } from './telemetry';
+export type { TelemetryProviderProps, TelemetryFunctions } from './telemetry';
+
+// Main Playground Component
+export { Playground } from './components/Playground';
+
+// UI Components (for advanced customization)
+export * from './components/ui';
diff --git a/libs/typescript/playground/src/telemetry/index.tsx b/libs/typescript/playground/src/telemetry/index.tsx
new file mode 100644
index 0000000000..9a13882b74
--- /dev/null
+++ b/libs/typescript/playground/src/telemetry/index.tsx
@@ -0,0 +1,74 @@
+import { createContext, useContext, useCallback, type ReactNode } from 'react';
+import type { Model } from '../types';
+
+/**
+ * Telemetry function types
+ */
+export interface TelemetryFunctions {
+ trackPlaygroundViewed: () => void;
+ trackMessageSent: (params: {
+ model: Model | undefined;
+ isFirstMessage: boolean;
+ sandboxType: 'vm' | 'custom';
+ message: string;
+ }) => void;
+ trackTrajectoryCompleted: (params: {
+ model: Model | undefined;
+ iterationCount: number;
+ durationMs: number;
+ }) => void;
+ trackTrajectoryFailed: (params: { model: Model | undefined; errorType: string }) => void;
+ trackTrajectoryStopped: (params: { model: Model | undefined }) => void;
+ trackExamplePromptSelected: (params: { promptId: string; promptTitle: string }) => void;
+ trackTrajectoryExported: (params: { runCount: number }) => void;
+ trackTrajectoryReplayed: (params: { runIndex: number }) => void;
+}
+
+/**
+ * Telemetry context - allows consumers to provide their own telemetry implementation
+ */
+const TelemetryContext = createContext<TelemetryFunctions | null>(null);
+
+/**
+ * Telemetry provider props
+ */
+export interface TelemetryProviderProps {
+ children: ReactNode;
+ /** Custom telemetry functions - if not provided, uses no-op */
+ telemetry?: TelemetryFunctions;
+}
+
+/**
+ * Telemetry provider that allows consumers to inject their own tracking implementation.
+ * If no telemetry prop is provided, uses no-op functions.
+ */
+export function TelemetryProvider({ children, telemetry }: TelemetryProviderProps) {
+ return (
+ <TelemetryContext.Provider value={telemetry ?? null}>{children}</TelemetryContext.Provider>
+ );
+}
+
+/**
+ * Hook to access telemetry functions.
+ * Returns no-op functions if no TelemetryProvider with custom telemetry is present.
+ */
+export function usePlaygroundTelemetry(): TelemetryFunctions {
+ const context = useContext(TelemetryContext);
+ const noop = useCallback(() => {}, []);
+
+ // If context is provided, use it; otherwise return no-op functions
+ if (context) {
+ return context;
+ }
+
+ return {
+ trackPlaygroundViewed: noop,
+ trackMessageSent: noop as TelemetryFunctions['trackMessageSent'],
+ trackTrajectoryCompleted: noop as TelemetryFunctions['trackTrajectoryCompleted'],
+ trackTrajectoryFailed: noop as TelemetryFunctions['trackTrajectoryFailed'],
+ trackTrajectoryStopped: noop as TelemetryFunctions['trackTrajectoryStopped'],
+ trackExamplePromptSelected: noop as TelemetryFunctions['trackExamplePromptSelected'],
+ trackTrajectoryExported: noop as TelemetryFunctions['trackTrajectoryExported'],
+ trackTrajectoryReplayed: noop as TelemetryFunctions['trackTrajectoryReplayed'],
+ };
+}
diff --git a/libs/typescript/playground/src/types/chat.ts b/libs/typescript/playground/src/types/chat.ts
new file mode 100644
index 0000000000..7f7e3df983
--- /dev/null
+++ b/libs/typescript/playground/src/types/chat.ts
@@ -0,0 +1,154 @@
+// Types copied from cloud/src/website/app/types.ts and cloud/src/website/app/contexts/ChatContext.tsx
+// IMPORTANT: Keep these in sync with the source files
+
+import type {
+ AgentMessage,
+ ComputerCallOutputMessage,
+} from './messages';
+
+// Model type
+export interface Model {
+ id: string;
+ name: string;
+}
+
+// API Key Settings Types (used by playground)
+export type ApiKeyOption = 'cua' | 'custom' | 'none';
+
+export interface ApiKeySettings {
+ option: ApiKeyOption;
+ selectedCuaKey: string;
+ customKey: string;
+}
+
+// Chat error type
+export interface ChatError {
+ message: string;
+ timestamp: Date;
+}
+
+// Model provider type
+export interface ModelProvider {
+ name: string;
+ models: Model[];
+}
+
+// Custom computer type (user-provided URLs)
+export interface CustomComputer {
+ id: string;
+ url: string;
+ name: string;
+}
+
+// VM Status enum
+export enum VMStatus {
+ Provisioning = 'provisioning',
+ Failed = 'failed',
+ Starting = 'starting',
+ Running = 'running',
+ Restarting = 'restarting',
+ Stopping = 'stopping',
+ Stopped = 'stopped',
+ Suspending = 'suspending',
+ Suspended = 'suspended',
+ Preempted = 'preempted',
+ Error = 'error',
+ Deleting = 'deleting',
+ Deleted = 'deleted',
+}
+
+// VM type (from cloud)
+export interface VM {
+ id: string;
+ vmId: string;
+ name: string;
+ status: string;
+ vncUrl: string | null;
+ customName?: string;
+ size?: string;
+ region?: string;
+ os?: string;
+ workspaceName?: string | null;
+}
+
+// Unified computer type that is a union of VM and CustomComputer
+export type Computer = VM | CustomComputer;
+
+// Type guards for Computer union type
+export function isVM(computer: Computer): computer is VM {
+ return 'vmId' in computer;
+}
+
+export function isCustomComputer(computer: Computer): computer is CustomComputer {
+ return 'url' in computer && !('vmId' in computer);
+}
+
+// Helper functions to get common properties
+export function getComputerId(computer: Computer): string {
+ return isVM(computer) ? computer.vmId.toString() : computer.id;
+}
+
+export function getComputerName(computer: Computer): string {
+ if (isVM(computer)) {
+ return computer.customName || computer.name;
+ }
+ return computer.name;
+}
+
+// Chat interface
+export interface Chat {
+ id: string;
+ name: string;
+ model?: Model;
+ computer?: Computer;
+ updated: Date;
+ created: Date;
+ messages: AgentMessage[];
+}
+
+// Processed message type for rendering (from ChatContext.tsx)
+export interface ProcessedMessage {
+ type: 'single';
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ toolCalls?: {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ output?: AgentMessage;
+ }[];
+}
+
+// Retry state for displaying retry progress
+export interface RetryState {
+ attempt: number;
+ maxRetries: number;
+}
+
+// Chat state type (from ChatContext.tsx)
+export interface ChatState {
+ id: string;
+ name: string;
+ messages: AgentMessage[];
+ model?: Model;
+ computer?: Computer;
+ currentInput: string;
+ waitingForResponse: boolean;
+ chatError: ChatError | null;
+ processedMessages: ProcessedMessage[];
+ retryState: RetryState | null;
+}
+
+// Chat action types (from ChatContext.tsx)
+export type ChatAction =
+ | { type: 'SET_INPUT'; payload: string }
+ | { type: 'SET_MODEL'; payload: Model }
+ | { type: 'SET_COMPUTER'; payload: Computer }
+ | { type: 'ADD_MESSAGE'; payload: AgentMessage }
+ | { type: 'SET_MESSAGES'; payload: AgentMessage[] }
+ | { type: 'APPEND_MESSAGES'; payload: AgentMessage[] }
+ | { type: 'SET_WAITING'; payload: boolean }
+ | { type: 'SET_ERROR'; payload: ChatError | null }
+ | { type: 'SET_RETRY_STATE'; payload: RetryState | null }
+ | { type: 'UPDATE_NAME'; payload: string }
+ | { type: 'CLEAR_INPUT' }
+ | { type: 'RESET_CHAT'; payload: Chat };
diff --git a/libs/typescript/playground/src/types/index.ts b/libs/typescript/playground/src/types/index.ts
new file mode 100644
index 0000000000..b161211274
--- /dev/null
+++ b/libs/typescript/playground/src/types/index.ts
@@ -0,0 +1,54 @@
+// Barrel export for all types
+
+// Message types (re-exported from @trycua/agent + additional types)
+export type {
+ AgentMessage,
+ UserMessage,
+ AssistantMessage,
+ ReasoningMessage,
+ ComputerCallMessage,
+ ComputerCallOutputMessage,
+ OutputContent,
+ SummaryContent,
+ InputContent,
+ ComputerAction,
+ ClickAction,
+ TypeAction,
+ KeyPressAction,
+ ScrollAction,
+ WaitAction,
+ Usage,
+ AgentRequest,
+ AgentResponse,
+ ConnectionType,
+ AgentClientOptions,
+ FunctionCallMessage,
+ FunctionCallOutputMessage,
+ ComputerResultContent,
+ AgentKwargs,
+} from './messages';
+
+// Chat types (copied from cloud repo)
+export type {
+ Model,
+ ApiKeyOption,
+ ApiKeySettings,
+ ChatError,
+ ModelProvider,
+ CustomComputer,
+ VM,
+ Computer,
+ Chat,
+ ProcessedMessage,
+ RetryState,
+ ChatState,
+ ChatAction,
+} from './chat';
+
+export {
+ VMStatus,
+ isVM,
+ isCustomComputer,
+ getComputerId,
+ getComputerName,
+} from './chat';
diff --git a/libs/typescript/playground/src/types/messages.ts b/libs/typescript/playground/src/types/messages.ts
new file mode 100644
index 0000000000..4c5ee7abfc
--- /dev/null
+++ b/libs/typescript/playground/src/types/messages.ts
@@ -0,0 +1,226 @@
+// Core message types for the playground
+// These types are compatible with @trycua/agent but defined locally to avoid
+// workspace dependency issues when consuming the package externally
+
+// #region Request
+export type ConnectionType = 'http' | 'https' | 'peer';
+
+export interface AgentClientOptions {
+ timeout?: number;
+ retries?: number;
+ /** Optional Cua API key to send as X-API-Key header for HTTP requests */
+ apiKey?: string;
+}
+
+export interface AgentRequest {
+ model: string;
+ input: string | AgentMessage[];
+ agent_kwargs?: {
+ save_trajectory?: boolean;
+ verbosity?: number;
+ [key: string]: unknown;
+ };
+ computer_kwargs?: {
+ os_type?: string;
+ provider_type?: string;
+ [key: string]: unknown;
+ };
+ /** Optional per-request environment variable overrides */
+ env?: Record<string, string>;
+}
+// #endregion
+
+// #region Response
+export interface AgentResponse {
+ output: AgentMessage[];
+ usage: Usage;
+ status: 'completed' | 'failed';
+ error?: string;
+}
+
+export interface Usage {
+ prompt_tokens: number;
+ completion_tokens: number;
+ total_tokens: number;
+ response_cost: number;
+}
+// #endregion
+
+// #region Messages
+export type AgentMessage =
+ | UserMessage
+ | AssistantMessage
+ | ReasoningMessage
+ | ComputerCallMessage
+ | ComputerCallOutputMessage
+ | FunctionCallMessage
+ | FunctionCallOutputMessage;
+
+export interface UserMessage {
+ type?: 'message';
+ role: 'user' | 'system' | 'developer';
+ content: string | InputContent[];
+}
+
+export interface AssistantMessage {
+ type: 'message';
+ role: 'assistant';
+ content: OutputContent[];
+}
+
+export interface ReasoningMessage {
+ type: 'reasoning';
+ summary: SummaryContent[];
+}
+
+export interface ComputerCallMessage {
+ type: 'computer_call';
+ call_id: string;
+ status: 'completed' | 'failed' | 'pending';
+ action: ComputerAction;
+}
+
+export interface ComputerCallOutputMessage {
+ type: 'computer_call_output';
+ call_id: string;
+ output: ComputerResultContent;
+}
+
+export interface FunctionCallMessage {
+ type: 'function_call';
+ call_id: string;
+ status: 'completed' | 'failed' | 'pending';
+ name: string;
+ arguments: string; // JSON dict of kwargs
+}
+
+export interface FunctionCallOutputMessage {
+ type: 'function_call_output';
+ call_id: string;
+ output: string;
+}
+// #endregion
+
+// #region Message Content
+export interface InputContent {
+ type: 'input_image' | 'input_text';
+ text?: string;
+ image_url?: string;
+}
+
+export interface OutputContent {
+ type: 'output_text';
+ text: string;
+}
+
+export interface SummaryContent {
+ type: 'summary_text';
+ text: string;
+}
+
+export interface ComputerResultContent {
+ type: 'computer_screenshot' | 'input_image';
+ image_url: string;
+}
+// #endregion
+
+// #region Actions
+export type ComputerAction = ComputerActionOpenAI | ComputerActionAnthropic;
+
+export type ComputerActionOpenAI =
+ | ClickAction
+ | DoubleClickAction
+ | DragAction
+ | KeyPressAction
+ | MoveAction
+ | ScreenshotAction
+ | ScrollAction
+ | TypeAction
+ | WaitAction;
+
+export interface ClickAction {
+ type: 'click';
+ button: 'left' | 'right' | 'wheel' | 'back' | 'forward';
+ x: number;
+ y: number;
+}
+
+export interface DoubleClickAction {
+ type: 'double_click';
+ button?: 'left' | 'right' | 'wheel' | 'back' | 'forward';
+ x: number;
+ y: number;
+}
+
+export interface DragAction {
+ type: 'drag';
+ button?: 'left' | 'right' | 'wheel' | 'back' | 'forward';
+ path: Array<[number, number]>;
+}
+
+export interface KeyPressAction {
+ type: 'keypress';
+ keys: string[];
+}
+
+export interface MoveAction {
+ type: 'move';
+ x: number;
+ y: number;
+}
+
+export interface ScreenshotAction {
+ type: 'screenshot';
+}
+
+export interface ScrollAction {
+ type: 'scroll';
+ scroll_x: number;
+ scroll_y: number;
+ x: number;
+ y: number;
+}
+
+export interface TypeAction {
+ type: 'type';
+ text: string;
+}
+
+export interface WaitAction {
+ type: 'wait';
+}
+
+export type ComputerActionAnthropic = LeftMouseDownAction | LeftMouseUpAction;
+
+export interface LeftMouseDownAction {
+ type: 'left_mouse_down';
+ x: number;
+ y: number;
+}
+
+export interface LeftMouseUpAction {
+ type: 'left_mouse_up';
+ x: number;
+ y: number;
+}
+// #endregion
+
+// Agent kwargs matching ComputerAgent constructor parameters
+export interface AgentKwargs {
+ tools?: unknown[];
+ custom_loop?: unknown;
+ only_n_most_recent_images?: number;
+ callbacks?: unknown[];
+ instructions?: string;
+ verbosity?: number;
+ trajectory_dir?: string | Record<string, unknown>;
+ max_retries?: number;
+ screenshot_delay?: number;
+ use_prompt_caching?: boolean;
+ max_trajectory_budget?: number | Record<string, unknown>;
+ telemetry_enabled?: boolean | { log_trajectory?: boolean };
+ trust_remote_code?: boolean;
+ api_key?: string;
+ api_base?: string;
+ [key: string]: unknown;
+}
diff --git a/libs/typescript/playground/src/utils/cn.ts b/libs/typescript/playground/src/utils/cn.ts
new file mode 100644
index 0000000000..9ad0df4269
--- /dev/null
+++ b/libs/typescript/playground/src/utils/cn.ts
@@ -0,0 +1,6 @@
+import { type ClassValue, clsx } from 'clsx';
+import { twMerge } from 'tailwind-merge';
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
diff --git a/libs/typescript/playground/src/utils/index.ts b/libs/typescript/playground/src/utils/index.ts
new file mode 100644
index 0000000000..a0d1b7dabe
--- /dev/null
+++ b/libs/typescript/playground/src/utils/index.ts
@@ -0,0 +1,15 @@
+export { cn } from './cn';
+export { processMessagesForRendering } from './messageProcessing';
+
+// localStorage utilities (used by local adapter)
+export {
+ type StorageConfig,
+ saveItemsToLocalStorage,
+ loadItemsFromLocalStorage,
+ saveItemToLocalStorage,
+ loadItemFromLocalStorage,
+ clearItemsFromLocalStorage,
+} from './localStorage';
+
+// Trajectory utilities (for export/replay features)
+export { inferRuns, type TrajectoryRun } from './trajectory';
diff --git a/libs/typescript/playground/src/utils/localStorage.ts b/libs/typescript/playground/src/utils/localStorage.ts
new file mode 100644
index 0000000000..8d4fb1b8a6
--- /dev/null
+++ b/libs/typescript/playground/src/utils/localStorage.ts
@@ -0,0 +1,166 @@
+// Generic localStorage utility that works with any object type
+export interface StorageConfig<T> {
+ storageKey: string;
+ serialize?: (item: T) => unknown;
+ deserialize?: (item: unknown) => T;
+}
+
+// Type guard to check if a value is a record (plain object)
+const isRecord = (value: unknown): value is Record<string, unknown> => {
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
+};
+
+// Type guard to check if a string looks like an ISO date
+const isISODateString = (value: string): boolean => {
+ return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(value);
+};
+
+// Default serializer for objects with Date properties
+const defaultSerializer = (obj: unknown): unknown => {
+ if (!obj || typeof obj !== 'object') return obj;
+
+ if (Array.isArray(obj)) {
+ return obj.map(defaultSerializer);
+ }
+
+ if (isRecord(obj)) {
+ const serialized: Record<string, unknown> = {};
+ for (const [key, value] of Object.entries(obj)) {
+ if (value instanceof Date) {
+ serialized[key] = value.toISOString();
+ } else if (value && typeof value === 'object') {
+ serialized[key] = defaultSerializer(value);
+ } else {
+ serialized[key] = value;
+ }
+ }
+ return serialized;
+ }
+
+ return obj;
+};
+
+// Default deserializer for objects with Date properties
+const defaultDeserializer = (obj: unknown): unknown => {
+ if (!obj || typeof obj !== 'object') return obj;
+
+ if (Array.isArray(obj)) {
+ return obj.map(defaultDeserializer);
+ }
+
+ if (isRecord(obj)) {
+ const deserialized: Record<string, unknown> = {};
+
+ for (const [key, value] of Object.entries(obj)) {
+ if (typeof value === 'string' && isISODateString(value)) {
+ // Try to parse as Date if it looks like an ISO string
+ const date = new Date(value);
+ deserialized[key] = Number.isNaN(date.getTime()) ? value : date;
+ } else if (value && typeof value === 'object') {
+ deserialized[key] = defaultDeserializer(value);
+ } else {
+ deserialized[key] = value;
+ }
+ }
+
+ return deserialized;
+ }
+
+ return obj;
+};
+
+// Save array of items to localStorage
+export const saveItemsToLocalStorage = <T>(
+ items: T[],
+ config: StorageConfig<T>
+): void => {
+ try {
+ if (typeof window === 'undefined') return;
+ const serializer = config.serialize || defaultSerializer;
+ const serializedItems = items.map(serializer);
+ localStorage.setItem(config.storageKey, JSON.stringify(serializedItems));
+ } catch (error) {
+ console.error(
+ `Failed to save items to localStorage (${config.storageKey}):`,
+ error
+ );
+ }
+};
+
+// Load array of items from localStorage
+export const loadItemsFromLocalStorage = <T>(config: StorageConfig<T>): T[] => {
+ try {
+ if (typeof window === 'undefined') return [];
+ const stored = localStorage.getItem(config.storageKey);
+ if (!stored) return [];
+
+ const parsedItems: unknown = JSON.parse(stored);
+
+ if (!Array.isArray(parsedItems)) {
+ console.warn(
+ `Expected array but got ${typeof parsedItems} from localStorage`
+ );
+ return [];
+ }
+
+ const deserializer = config.deserialize || defaultDeserializer;
+ return parsedItems.map((item) => deserializer(item) as T);
+ } catch (error) {
+ console.error(
+ `Failed to load items from localStorage (${config.storageKey}):`,
+ error
+ );
+ return [];
+ }
+};
+
+// Save single item to localStorage
+export const saveItemToLocalStorage = <T>(
+ item: T,
+ config: StorageConfig<T>
+): void => {
+ try {
+ if (typeof window === 'undefined') return;
+ const serializer = config.serialize || defaultSerializer;
+ const serializedItem = serializer(item);
+ localStorage.setItem(config.storageKey, JSON.stringify(serializedItem));
+ } catch (error) {
+ console.error(
+ `Failed to save item to localStorage (${config.storageKey}):`,
+ error
+ );
+ }
+};
+
+// Load single item from localStorage
+export const loadItemFromLocalStorage = <T>(
+ config: StorageConfig<T>
+): T | null => {
+ try {
+ if (typeof window === 'undefined') return null;
+ const stored = localStorage.getItem(config.storageKey);
+ if (!stored) return null;
+
+ const parsedItem: unknown = JSON.parse(stored);
+ const deserializer = config.deserialize || defaultDeserializer;
+ return deserializer(parsedItem) as T;
+ } catch (error) {
+ console.error(
+ `Failed to load item from localStorage (${config.storageKey}):`,
+ error
+ );
+ return null;
+ }
+};
+
+// Clear items from localStorage
+export const clearItemsFromLocalStorage = (storageKeys: string[]): void => {
+ try {
+ if (typeof window === 'undefined') return;
+ storageKeys.forEach((key) => {
+ localStorage.removeItem(key);
+ });
+ } catch (error) {
+ console.error('Failed to clear items from localStorage:', error);
+ }
+};
diff --git a/libs/typescript/playground/src/utils/messageProcessing.ts b/libs/typescript/playground/src/utils/messageProcessing.ts
new file mode 100644
index 0000000000..592020ea67
--- /dev/null
+++ b/libs/typescript/playground/src/utils/messageProcessing.ts
@@ -0,0 +1,143 @@
+import type { AgentMessage, ComputerCallOutputMessage } from '../types';
+
+// Process messages to group tool calls and add screenshots
+export const processMessagesForRendering = (messages: AgentMessage[]) => {
+ const processedMessages: Array<{
+ type: 'single';
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ toolCalls?: {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ output?: AgentMessage;
+ }[];
+ }> = [];
+
+ const createPlaceholderAssistantMessage = (): AgentMessage => ({
+ content: [],
+ role: 'assistant',
+ type: 'message',
+ });
+
+ const isToolCallMessage = (message: AgentMessage) => {
+ return (
+ message.type === 'computer_call' ||
+ message.type === 'function_call' ||
+ message.type === 'reasoning'
+ );
+ };
+
+ const isToolCallOutputMessage = (message: AgentMessage) => {
+ return message.type === 'computer_call_output' || message.type === 'function_call_output';
+ };
+
+ for (let i = 0; i < messages.length; i++) {
+ const message = messages[i];
+
+ if (isToolCallMessage(message)) {
+ // Start collecting consecutive tool calls
+ const toolCalls: {
+ message: AgentMessage;
+ screenshot?: ComputerCallOutputMessage;
+ output?: AgentMessage;
+ }[] = [];
+
+ // Process current message and any consecutive tool calls
+ let j = i;
+ while (
+ j < messages.length &&
+ (isToolCallMessage(messages[j]) || isToolCallOutputMessage(messages[j]))
+ ) {
+ const currentMessage = messages[j];
+
+ if (currentMessage.type === 'computer_call') {
+ // Look for matching computer_call_output
+ const nextMessage = messages[j + 1];
+ let screenshot: ComputerCallOutputMessage | undefined;
+
+ if (
+ nextMessage &&
+ nextMessage.type === 'computer_call_output' &&
+ (nextMessage as ComputerCallOutputMessage).call_id === (currentMessage as any).call_id
+ ) {
+ screenshot = nextMessage as ComputerCallOutputMessage;
+ j++; // Skip the output message
+ }
+
+ toolCalls.push({ message: currentMessage, screenshot });
+ } else if (currentMessage.type === 'function_call') {
+ // Look for matching function_call_output and store it with the function_call
+ const nextMessage = messages[j + 1];
+ let output: AgentMessage | undefined;
+
+ if (
+ nextMessage &&
+ nextMessage.type === 'function_call_output' &&
+ (nextMessage as any).call_id === (currentMessage as any).call_id
+ ) {
+ output = nextMessage;
+ j++; // Skip the output message
+ }
+
+ toolCalls.push({ message: currentMessage, output });
+ } else if (currentMessage.type === 'computer_call_output') {
+ // Skip standalone output messages (should have been grouped)
+ const prevMessage = messages[j - 1];
+ if (
+ !prevMessage ||
+ prevMessage.type !== 'computer_call' ||
+ (prevMessage as any).call_id !== (currentMessage as any).call_id
+ ) {
+ toolCalls.push({ message: currentMessage });
+ }
+ } else if (currentMessage.type === 'function_call_output') {
+ // Skip standalone output messages (should have been grouped)
+ const prevMessage = messages[j - 1];
+ if (
+ !prevMessage ||
+ prevMessage.type !== 'function_call' ||
+ (prevMessage as any).call_id !== (currentMessage as any).call_id
+ ) {
+ toolCalls.push({ message: currentMessage });
+ }
+ } else if (currentMessage.type === 'reasoning') {
+ toolCalls.push({ message: currentMessage });
+ }
+
+ j++;
+ }
+
+ // If we have tool calls, attach them to the previous assistant message
+ if (toolCalls.length > 0) {
+ const lastMessage = processedMessages[processedMessages.length - 1];
+
+ // Attach to previous message if it exists and is NOT a user message; otherwise, insert a placeholder
+ const isPreviousUser =
+ !!lastMessage &&
+ lastMessage.type === 'single' &&
+ lastMessage.message.type === 'message' &&
+ (lastMessage.message as any).role === 'user';
+
+ if (lastMessage && lastMessage.type === 'single' && !isPreviousUser) {
+ lastMessage.toolCalls = toolCalls;
+ } else {
+ processedMessages.push({
+ type: 'single',
+ message: createPlaceholderAssistantMessage(),
+ toolCalls,
+ });
+ }
+ }
+
+ i = j - 1; // Update main loop index
+ } else {
+ // Non-tool call message
+ processedMessages.push({
+ type: 'single',
+ message,
+ });
+ }
+ }
+
+ return processedMessages;
+};
diff --git a/libs/typescript/playground/src/utils/trajectory.ts b/libs/typescript/playground/src/utils/trajectory.ts
new file mode 100644
index 0000000000..316bbfad36
--- /dev/null
+++ b/libs/typescript/playground/src/utils/trajectory.ts
@@ -0,0 +1,132 @@
+import type { AgentMessage, UserMessage } from '../types';
+
+/**
+ * Represents a single agent run (trajectory) starting from a user message
+ */
+export interface TrajectoryRun {
+ /** 0-based index of this run in the chat */
+ index: number;
+ /** Preview of the user's prompt (truncated for display) */
+ userPromptPreview: string;
+ /** Full user prompt text */
+ userPrompt: string;
+ /** All messages in this run (including the starting user message) */
+ messages: AgentMessage[];
+ /** Number of screenshots in this run */
+ screenshotCount: number;
+ /** Number of agent actions (computer_call + function_call) */
+ actionCount: number;
+ /** Whether this run has any content beyond the user message */
+ isEmpty: boolean;
+}
+
+const MAX_PREVIEW_LENGTH = 60;
+
+/**
+ * Get preview text from a user message
+ */
+function getUserPromptText(message: UserMessage): string {
+ if (typeof message.content === 'string') {
+ return message.content;
+ }
+ // Extract text from InputContent array
+ const textParts = message.content
+ .filter((c) => c.type === 'input_text' && c.text)
+ .map((c) => c.text)
+ .filter(Boolean);
+ return textParts.join(' ') || '[Image input]';
+}
+
+/**
+ * Truncate text to a maximum length with ellipsis
+ */
+function truncate(text: string, maxLength: number): string {
+ const cleaned = text.replace(/\n/g, ' ').trim();
+ if (cleaned.length <= maxLength) {
+ return cleaned;
+ }
+ return `${cleaned.slice(0, maxLength - 3)}...`;
+}
+
+/**
+ * Check if a message is a user message (starts a new run)
+ */
+function isUserMessage(message: AgentMessage): message is UserMessage {
+ return (
+ message.type === 'message' ||
+ (message.type === undefined && 'role' in message && message.role === 'user')
+ );
+}
+
+/**
+ * Infer agent runs from a flat array of messages.
+ * Each UserMessage starts a new run. Consecutive UserMessages result in
+ * empty runs (no agent response) which are still valid for export.
+ *
+ * @param messages - The flat array of messages from a chat session
+ * @returns Array of TrajectoryRun objects
+ */
+export function inferRuns(messages: AgentMessage[]): TrajectoryRun[] {
+ const runs: TrajectoryRun[] = [];
+ let currentRunMessages: AgentMessage[] = [];
+ let currentRunIndex = 0;
+ let currentUserPrompt = '';
+
+ for (const message of messages) {
+ // Check if this is a user message (role === 'user')
+ const isUser = isUserMessage(message) && 'role' in message && message.role === 'user';
+
+ if (isUser) {
+ // If we have accumulated messages, save the previous run
+ if (currentRunMessages.length > 0) {
+ runs.push(createRun(currentRunIndex, currentUserPrompt, currentRunMessages));
+ currentRunIndex++;
+ }
+
+ // Start new run with this user message
+ currentUserPrompt = getUserPromptText(message as UserMessage);
+ currentRunMessages = [message];
+ } else {
+ // Non-user message: add to current run
+ currentRunMessages.push(message);
+ }
+ }
+
+ // Don't forget the last run
+ if (currentRunMessages.length > 0) {
+ runs.push(createRun(currentRunIndex, currentUserPrompt, currentRunMessages));
+ }
+
+ return runs;
+}
+
+/**
+ * Create a TrajectoryRun object from collected messages
+ */
+function createRun(index: number, userPrompt: string, messages: AgentMessage[]): TrajectoryRun {
+ let screenshotCount = 0;
+ let actionCount = 0;
+
+ for (const msg of messages) {
+ if (msg.type === 'computer_call_output') {
+ screenshotCount++;
+ }
+ if (msg.type === 'computer_call' || msg.type === 'function_call') {
+ actionCount++;
+ }
+ }
+
+ // A run is empty if it only contains the user message (no agent response)
+ const firstMsg = messages[0];
+ const isEmpty = messages.length === 1 && 'role' in firstMsg && firstMsg.role === 'user';
+
+ return {
+ index,
+ userPromptPreview: truncate(userPrompt, MAX_PREVIEW_LENGTH),
+ userPrompt,
+ messages,
+ screenshotCount,
+ actionCount,
+ isEmpty,
+ };
+}
diff --git a/libs/typescript/playground/tsconfig.json b/libs/typescript/playground/tsconfig.json
new file mode 100644
index 0000000000..9141ed18d1
--- /dev/null
+++ b/libs/typescript/playground/tsconfig.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "target": "esnext",
+ "lib": ["es2023", "dom", "dom.iterable"],
+ "moduleDetection": "force",
+ "module": "preserve",
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "resolveJsonModule": true,
+ "allowSyntheticDefaultImports": true,
+ "strict": true,
+ "noUnusedLocals": true,
+ "declaration": true,
+ "emitDeclarationOnly": true,
+ "esModuleInterop": true,
+ "isolatedModules": true,
+ "verbatimModuleSyntax": true,
+ "skipLibCheck": true,
+ "jsx": "react-jsx"
+ },
+ "include": ["src"]
+}
diff --git a/libs/typescript/playground/tsdown.config.ts b/libs/typescript/playground/tsdown.config.ts
new file mode 100644
index 0000000000..07495ce10c
--- /dev/null
+++ b/libs/typescript/playground/tsdown.config.ts
@@ -0,0 +1,25 @@
+import { defineConfig } from 'tsdown';
+
+export default defineConfig([
+ {
+ entry: ['./src/index.ts'],
+ platform: 'browser',
+ dts: true,
+ external: [
+ // React - MUST be external to avoid duplicate React instances
+ 'react',
+ 'react-dom',
+ 'react/jsx-runtime',
+ 'react/jsx-dev-runtime',
+ // Animation (motion v12+) - uses React hooks
+ 'motion',
+ 'motion/react',
+ // Radix UI - uses React hooks
+ /^@radix-ui\/.*/,
+ // lucide-react - uses React
+ 'lucide-react',
+ // Note: lottie-react, react-markdown are BUNDLED
+ // because they have ESM resolution issues with pnpm file: protocol
+ ],
+ },
+]);
diff --git a/libs/typescript/pnpm-lock.yaml b/libs/typescript/pnpm-lock.yaml
index 2a5bbf2cff..8644119115 100644
--- a/libs/typescript/pnpm-lock.yaml
+++ b/libs/typescript/pnpm-lock.yaml
@@ -10,13 +10,13 @@ importers:
devDependencies:
prettier:
specifier: ^3.6.2
- version: 3.6.2
+ version: 3.8.1
agent:
dependencies:
'@trycua/core':
specifier: ^0.1.2
- version: 0.1.3
+ version: link:../core
peerjs:
specifier: ^1.5.4
version: 1.5.5
@@ -26,13 +26,13 @@ importers:
devDependencies:
'@types/node':
specifier: ^22.15.17
- version: 22.19.1
+ version: 22.19.8
bumpp:
specifier: ^10.1.0
- version: 10.3.1
+ version: 10.4.0
happy-dom:
specifier: ^20.0.11
- version: 20.0.11
+ version: 20.5.0
tsdown:
specifier: ^0.14.1
version: 0.14.2([email protected])
@@ -41,13 +41,13 @@ importers:
version: 5.9.3
vitest:
specifier: ^4.0.14
computer:
dependencies:
'@trycua/core':
specifier: ^0.1.2
- version: 0.1.3
+ version: link:../core
pino:
specifier: ^9.7.0
version: 9.14.0
@@ -56,11 +56,11 @@ importers:
version: 11.1.0
ws:
specifier: ^8.18.0
- version: 8.18.3
+ version: 8.19.0
devDependencies:
'@types/node':
specifier: ^22.15.17
- version: 22.19.1
+ version: 22.19.8
'@types/uuid':
specifier: ^10.0.0
version: 10.0.0
@@ -69,22 +69,22 @@ importers:
version: 8.18.1
bumpp:
specifier: ^10.1.0
- version: 10.3.1
+ version: 10.4.0
happy-dom:
specifier: ^20.0.11
- version: 20.0.11
+ version: 20.5.0
tsdown:
specifier: ^0.11.9
version: 0.11.13([email protected])
tsx:
specifier: ^4.19.4
- version: 4.20.6
+ version: 4.21.0
typescript:
specifier: ^5.8.3
version: 5.9.3
vitest:
specifier: ^4.0.14
core:
dependencies:
@@ -96,40 +96,110 @@ importers:
version: 9.14.0
posthog-node:
specifier: ^5.14.1
- version: 5.14.1
+ version: 5.24.10
uuid:
specifier: ^11.1.0
version: 11.1.0
devDependencies:
'@types/node':
specifier: ^22.15.17
- version: 22.19.1
+ version: 22.19.8
'@types/ws':
specifier: ^8.18.1
version: 8.18.1
bumpp:
specifier: ^10.1.0
- version: 10.3.1
+ version: 10.4.0
happy-dom:
specifier: ^20.0.11
- version: 20.0.11
+ version: 20.5.0
tsdown:
specifier: ^0.11.9
version: 0.11.13([email protected])
tsx:
specifier: ^4.19.4
- version: 4.20.6
+ version: 4.21.0
typescript:
specifier: ^5.8.3
version: 5.9.3
vitest:
specifier: ^4.0.14
+
+ playground:
+ dependencies:
+ '@radix-ui/react-dialog':
+ specifier: ^1.1.15
+ '@radix-ui/react-dropdown-menu':
+ specifier: ^2.1.16
+ '@radix-ui/react-select':
+ specifier: ^2.2.5
+ '@radix-ui/react-slot':
+ specifier: ^1.0.0
+ version: 1.2.4(@types/[email protected])([email protected])
+ '@radix-ui/react-tooltip':
+ specifier: ^1.2.8
+ '@zip.js/zip.js':
+ specifier: ^2.7.0
+ version: 2.8.16
+ class-variance-authority:
+ specifier: ^0.7.0
+ version: 0.7.1
+ clsx:
+ specifier: ^2.0.0
+ version: 2.1.1
+ lottie-react:
+ specifier: ^2.4.0
+ react:
+ specifier: ^18.0.0 || ^19.0.0
+ version: 19.2.4
+ react-dom:
+ specifier: ^18.0.0 || ^19.0.0
+ version: 19.2.4([email protected])
+ react-markdown:
+ specifier: ^9.0.0
+ version: 9.1.0(@types/[email protected])([email protected])
+ remark-gfm:
+ specifier: ^4.0.0
+ version: 4.0.1
+ tailwind-merge:
+ specifier: ^2.0.0
+ version: 2.6.1
+ devDependencies:
+ '@types/react':
+ specifier: ^18.0.0
+ version: 18.3.27
+ '@types/react-dom':
+ specifier: ^18.0.0
+ version: 18.3.7(@types/[email protected])
+ bumpp:
+ specifier: ^10.1.0
+ version: 10.4.0
+ lucide-react:
+ specifier: ^0.400.0
+ version: 0.400.0([email protected])
+ motion:
+ specifier: ^12.0.0
+ tsdown:
+ specifier: ^0.11.9
+ version: 0.11.13([email protected])
+ typescript:
+ specifier: ^5.8.3
+ version: 5.9.3
+ vitest:
+ specifier: ^4.0.14
packages:
- '@babel/[email protected]':
- resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==}
engines: {node: '>=6.9.0'}
@@ -140,180 +210,195 @@ packages:
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
engines: {node: '>=6.9.0'}
- '@babel/[email protected]':
- resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==}
engines: {node: '>=6.0.0'}
hasBin: true
- '@babel/[email protected]':
- resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
engines: {node: '>=6.9.0'}
- '@emnapi/[email protected]':
- resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==}
+ '@emnapi/[email protected]':
+ resolution: {integrity: sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==}
- '@emnapi/[email protected]':
- resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==}
+ '@emnapi/[email protected]':
+ resolution: {integrity: sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==}
'@emnapi/[email protected]':
resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==}
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [netbsd]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==}
engines: {node: '>=18'}
cpu: [x64]
os: [openbsd]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openharmony]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
- '@esbuild/[email protected]':
- resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==}
+
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==}
+
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-0tLRojf/1Go2JgEVm+3Frg9A3IW8bJgKgdO0BN5RkF//ufuz2joZM63Npau2ff3J6lUVYgDSNzNkR+aH3IVfjg==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
@@ -337,8 +422,8 @@ packages:
'@napi-rs/[email protected]':
resolution: {integrity: sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==}
- '@oxc-project/[email protected]':
- resolution: {integrity: sha512-6Ct21OIlrEnFEJk5LT4e63pk3btsI6/TusD/GStLi7wYlGJNOl1GI9qvXAnRAxQU9zqA2Oz+UwhfTOU2rPZVow==}
+ '@oxc-project/[email protected]':
+ resolution: {integrity: sha512-m6RebKHIRsax2iCwVpYW2ErQwa4ywHJrE4sCK3/8JK8ZZAWOKXaRJFl/uP51gaVyyXlaS4+chU1nSCdzYf6QqQ==}
'@oxc-project/[email protected]':
resolution: {integrity: sha512-ngyLUpUjO3dpqygSRQDx7nMx8+BmXbWOU4oIwTJFV2MVIDG7knIZwgdwXlQWLg3C3oxg1lS7ppMtPKqKFb7wzw==}
@@ -346,14 +431,353 @@ packages:
'@pinojs/[email protected]':
resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==}
- '@posthog/[email protected]':
- resolution: {integrity: sha512-Tbh8UACwbb7jFdDC7wwXHtfNzO+4wKh3VbyMHmp2UBe6w1jliJixexTJNfkqdGZm+ht3M10mcKvGGPnoZ2zLBg==}
+ '@posthog/[email protected]':
+ resolution: {integrity: sha512-e/F20we0t6bPMuDOVOe53f908s23vuKEpFKNXmZcx4bSYsPkjRN49akIIHU621HBJdcsFx537vhJYKZxu8uS9w==}
+
+ '@quansync/[email protected]':
+ resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==}
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==}
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==}
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-1PLGQEynI/3OX/ftV54COn+3Sud/Mn8vALg2rWnBLnRaGtJDduNW/22XjlGgPdpcIbiQxjKtb7BkcjP00nqfJw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-0NJQ4LFFUuWkE7Oxf0htBKS6zLkkjBH+hM1uk7Ng705ReR8m/uelduy1DBo0PyBXPKVnBA6YBlU94MBGXrSBCw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
- '@quansync/[email protected]':
- resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==}
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-He6ZoCfv5D7dlRbrhNBkuMVIHd0GDnjJwbICE1OWpG7G3S2gmJ+eXkcNLJjzjNDpeI2aRy56ou39AJM9AD8YFA==}
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-I30RydO+bnn2PQztvo25tswPH+wFBjehVGtmagkU78yMdwTwVf12wnAOF+AeP8S2N8xD+5UPbGhkUfPyvT+mwQ==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-tY7sVt1yL9ozIxvmbtN5qtmH2krXcBCfjEiCgKGLqunJHvgvZG2Pcl2oQ3kbcZARb1BGEHdkLzcYGO8ynVlieg==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==}
+
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-0T1k9FinuBZ/t7rZ8jN6OpUKPnUjNdYHoj/cESWrQ3ZraAJ4OMm6z7QjSfCxqj8mOp9kTKc1zHK3kGz5vMu+nQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
@@ -363,8 +787,8 @@ packages:
cpu: [arm64]
os: [darwin]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-YzJdn08kSOXnj85ghHauH2iHpOJ6eSmstdRTLyaziDcUxe9SyQJgGyx/5jDIhDvtOcNvMm2Ju7m19+S/Rm1jFg==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-JWWLzvcmc/3pe7qdJqPpuPk91SoE/N+f3PcWx/6ZwuyDVyungAEJPvKm/eEldiDdwTmaEzWfIR+HORxYWrCi1A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
@@ -374,8 +798,8 @@ packages:
cpu: [x64]
os: [darwin]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-cIvAbqM+ZVV6lBSKSBtlNqH5iCiW933t1q8j0H66B3sjbe8AxIRetVqfGgcHcJtMzBIkIALlL9fcDrElWLJQcQ==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-MTakBxfx3tde5WSmbHxuqlDsIW0EzQym+PJYGF4P6lG2NmKzi128OGynoFUqoD5ryCySEY85dug4v+LWGBElIw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
@@ -385,8 +809,8 @@ packages:
cpu: [x64]
os: [freebsd]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-rVt+B1B/qmKwCl1XD02wKfgh3vQPXRXdB/TicV2w6g7RVAM1+cZcpigwhLarqiVCxDObFZ7UgXCxPC7tpDoRog==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-jje3oopyOLs7IwfvXoS6Lxnmie5JJO7vW29fdGFu5YGY1EDbVDhD+P9vDihqS5X6fFiqL3ZQZCMBg6jyHkSVww==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
@@ -396,8 +820,8 @@ packages:
cpu: [arm]
os: [linux]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-69YKwJJBOFprQa1GktPgbuBOfnn+EGxu8sBJ1TjPER+zhSpYeaU4N07uqmyBiksOLGXsMegymuecLobfz03h8Q==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-A0n8P3hdLAaqzSFrQoA42p23ZKBYQOw+8EH5r15Sa9X1kD9/JXe0YT2gph2QTWvdr0CVK2BOXiK6ENfy6DXOag==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
@@ -407,8 +831,8 @@ packages:
cpu: [arm64]
os: [linux]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-9JDhHUf3WcLfnViFWm+TyorqUtnSAHaCzlSNmMOq824prVuuzDOK91K0Hl8DUcEb9M5x2O+d2/jmBMsetRIn3g==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-kWXkoxxarYISBJ4bLNf5vFkEbb4JvccOwxWDxuK9yee8lg5XA7OpvlTptfRuwEvYcOZf+7VS69Uenpmpyo5Bjw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
@@ -418,8 +842,8 @@ packages:
cpu: [arm64]
os: [linux]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-UvApLEGholmxw/HIwmUnLq3CwdydbhaHHllvWiCTNbyGom7wTwOtz5OAQbAKZYyiEOeIXZNPkM7nA4Dtng7CLw==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-Z03/wrqau9Bicfgb3Dbs6SYTHliELk2PM2LpG2nFd+cGupTMF5kanLEcj2vuuJLLhptNyS61rtk7SOZ+lPsTUA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
@@ -429,8 +853,8 @@ packages:
cpu: [x64]
os: [linux]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-uVctNgZHiGnJx5Fij7wHLhgw4uyZBVi6mykeWKOqE7bVy9Hcxn0fM/IuqdMwk6hXlaf9fFShDTFz2+YejP+x0A==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-iSXXZsQp08CSilff/DCTFZHSVEpEwdicV3W8idHyrByrcsRDVh9sGC3sev6d8BygSGj3vt8GvUKBPCoyMA4tgQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
@@ -440,14 +864,14 @@ packages:
cpu: [x64]
os: [linux]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-T6Eg0xWwcxd/MzBcuv4Z37YVbUbJxy5cMNnbIt/Yr99wFwli30O4BPlY8hKeGyn6lWNtU0QioBS46lVzDN38bg==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-qaj+MFudtdCv9xZo9znFvkgoajLdc+vwf0Kz5N44g+LU5XMe+IsACgn3UG7uTRlCCvhMAGXm1XlpEA5bZBrOcw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-PuGZVS2xNJyLADeh2F04b+Cz4NwvpglbtWACgrDOa5YDTEHKwmiTDjoD5eZ9/ptXtcpeFrMqD2H4Zn33KAh1Eg==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-U662UnMETyjT65gFmG9ma+XziENrs7BBnENi/27swZPYagubfHRirXHG2oMl+pEax2WvO7Kb9gHZmMakpYqBHQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
@@ -457,8 +881,8 @@ packages:
engines: {node: '>=14.21.3'}
cpu: [wasm32]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-2mOxY562ihHlz9lEXuaGEIDCZ1vI+zyFdtsoa3M62xsEunDXQE+DVPO4S4x5MPK9tKulG/aFcA/IH5eVN257Cw==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-gekrQ3Q2HiC1T5njGyuUJoGpK/l6B/TNXKed3fZXNf9YRTJn3L5MOZsFBn4bN2+UX+8+7hgdlTcEsexX988G4g==}
engines: {node: '>=14.0.0'}
cpu: [wasm32]
@@ -467,8 +891,8 @@ packages:
cpu: [arm64]
os: [win32]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-oQVOP5cfAWZwRD0Q3nGn/cA9FW3KhMMuQ0NIndALAe6obqjLhqYVYDiGGRGrxvnjJsVbpLwR14gIUYnpIcHR1g==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-85y5JifyMgs8m5K2XzR/VDsapKbiFiohl7s5lEj7nmNGO0pkTXE7q6TQScei96BNAsoK7JC3pA7ukA8WRHVJpg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
@@ -483,8 +907,8 @@ packages:
cpu: [x64]
os: [win32]
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-Ydsxxx++FNOuov3wCBPaYjZrEvKOOGq3k+BF4BPridhg2pENfitSRD2TEuQ8i33bp5VptuNdC9IzxRKU031z5A==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-a4VUQZH7LxGbUJ3qJ/TzQG8HxdHvf+jOnqf7B7oFx1TEBm+j2KNL2zr5SQ7wHkNAcaPevF6gf9tQnVBnC4mD+A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
@@ -492,124 +916,136 @@ packages:
'@rolldown/[email protected]':
resolution: {integrity: sha512-e9MeMtVWo186sgvFFJOPGy7/d2j2mZhLJIdVW0C/xDluuOvymEATqz6zKsP0ZmXGzQtqlyjz5sC1sYQUoJG98w==}
- '@rolldown/[email protected]':
- resolution: {integrity: sha512-UTBjtTxVOhodhzFVp/ayITaTETRHPUPYZPXQe0WU0wOgxghMojXxYjOiPOauKIYNWJAWS2fd7gJgGQK8GU8vDA==}
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==}
- '@rollup/[email protected]':
- resolution: {integrity: sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==}
cpu: [arm]
os: [android]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==}
cpu: [arm64]
os: [android]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==}
cpu: [arm64]
os: [darwin]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==}
cpu: [x64]
os: [darwin]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==}
cpu: [arm64]
os: [freebsd]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==}
cpu: [x64]
os: [freebsd]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==}
cpu: [arm]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==}
cpu: [arm]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==}
cpu: [arm64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==}
cpu: [arm64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==}
cpu: [loong64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==}
+ cpu: [loong64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==}
+ cpu: [ppc64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==}
cpu: [ppc64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==}
cpu: [riscv64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==}
cpu: [riscv64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==}
cpu: [s390x]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==}
cpu: [x64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==}
cpu: [x64]
os: [linux]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==}
+ cpu: [x64]
+ os: [openbsd]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==}
cpu: [arm64]
os: [openharmony]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==}
cpu: [arm64]
os: [win32]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==}
cpu: [ia32]
os: [win32]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==}
cpu: [x64]
os: [win32]
- '@rollup/[email protected]':
- resolution: {integrity: sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==}
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==}
cpu: [x64]
os: [win32]
- '@standard-schema/[email protected]':
- resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==}
-
- '@trycua/[email protected]':
- resolution: {integrity: sha512-sv7BEajJyZ+JNxrOdhao4qCOtRrh+S0XYf64ehAT4UAhLC73Kep06bGa/Uel0Ow5xGXXrg0aiVBL7zO9+/w4/Q==}
+ '@standard-schema/[email protected]':
+ resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}
resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==}
@@ -617,17 +1053,46 @@ packages:
resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}
+
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==}
+
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
- '@types/[email protected]':
- resolution: {integrity: sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ebO/Yl+EAvVe8DnMfi+iaAyIqYdK0q/q0y0rw82INWEKJOBe6b/P3YWE8NW7oOlF/nXFNrHwhARrN/hdgDkraA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==}
- '@types/[email protected]':
- resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==}
+ peerDependencies:
+ '@types/react': ^18.0.0
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==}
@@ -638,11 +1103,14 @@ packages:
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-RHk63V3zvRiYOWAV0rGEBRO820ce17hz7cI2kDmEdfQsBjT2luEKB5tCOc91u1oSQoUOZkSv3ZyzkdkSLD7lKw==}
+ '@ungap/[email protected]':
+ resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-8sCWUyckXXYvx4opfzVY03EOiYVxyNrHS5QxX3DAIi5dpJAAkyJezHCP77VMX4HKA2LDT/Jpfo8i2r5BE3GnQQ==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-RzS5NujlCzeRPF1MK7MXLiEFpkIXeMdQ+rN3Kk3tDI9j0mtbr7Nmuq67tpkOJQpgyClbOltCXMjLZicJHsH5Cg==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-HhVd0MDnzzsgevnOWCBj5Otnzobjy5wLBe4EdeeFGv8luMsGcYqDuFRMcttKWZA5vVO8RFjexVovXvAM4JoJDQ==}
peerDependencies:
msw: ^2.4.9
vite: ^6.0.0 || ^7.0.0-0
@@ -652,20 +1120,24 @@ packages:
vite:
optional: true
- '@vitest/[email protected]':
- resolution: {integrity: sha512-SOYPgujB6TITcJxgd3wmsLl+wZv+fy3av2PpiPpsWPZ6J1ySUYfScfpIt2Yv56ShJXR2MOA6q2KjKHN4EpdyRQ==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-P24GK3GulZWC5tz87ux0m8OADrQIUVDPIjjj65vBXYG17ZeU3qD7r+MNZ1RNv4l8CGU2vtTRqixrOi9fYk/yKw==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-BsAIk3FAqxICqREbX8SetIteT8PiaUL/tgJjmhxJhCsigmzzH8xeadtp7LRnTpCVzvf0ib9BgAfKJHuhNllKLw==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-rpk9y12PGa22Jg6g5M3UVVnTS7+zycIGk9ZNGN+m6tZHKQb7jrP7/77WfZy13Y/EUDd52NDsLRQhYKtv7XfPQw==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-aQVBfT1PMzDSA16Y3Fp45a0q8nKexx6N5Amw3MX55BeTeZpoC08fGqEZqVmPcqN0ueZsuUQ9rriPMhZ3Mu19Ag==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-PCiV0rcl7jKQjbgYqjtakly6T1uwv/5BQ9SwBLekVg/EaYeQFPiXcgrC2Y7vDMA8dM1SUEAEV82kgSQIlXNMvA==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-JmAZT1UtZooO0tpY3GRyiC/8W7dCs05UOq9rfsUUgEZEdq+DuHLmWhPsrTt0TiW7WYeL/hXpaE07AZ2RCk44hg==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-cbQt3PTSD7P2OARdVW3qWER5EGq7PHlvE+QfzSC0lbwO+xnt7+XH06ZzFjFRgzUX//JmpxrCu92VdwvEPlWSNw==}
- '@vitest/[email protected]':
- resolution: {integrity: sha512-hLqXZKAWNg8pI+SQXyXxWCTOpA3MvsqcbVeNgSi8x/CSN2wi26dSzn1wrOhmCmFjEvN9p8/kLFRHa6PI8jHazw==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-msMRKLMVLWygpK3u2Hybgi4MNjcYJvwTb0Ru09+fOyCXIgT5raYP041DRRdiJiI3k/2U6SEbAETB3YtBrUkCFA==}
+
+ '@zip.js/[email protected]':
+ resolution: {integrity: sha512-kCjaXh50GCf9afcof6ekjXPKR//rBVIxNHJLSUaM3VAET2F0+hymgrK1GpInRIIFUpt+wsnUfgx2+bbrmc+7Tw==}
+ engines: {bun: '>=0.7.0', deno: '>=1.0.0', node: '>=18.0.0'}
resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==}
@@ -674,6 +1146,10 @@ packages:
resolution: {integrity: sha512-xXAd7G2Mll5W8uo37GETpQ2VrE84M181Z7ugHFGQnJZ50M2mbOv0osSZ9VsSgPfJQ+LVG0prSi0th+ELMsno7Q==}
+ resolution: {integrity: sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==}
+ engines: {node: '>=10'}
+
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
engines: {node: '>=12'}
@@ -686,16 +1162,19 @@ packages:
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
engines: {node: '>=8.0.0'}
- resolution: {integrity: sha512-Bz2a4qD/5GRhiHSwj30c/8kC8QGj12nNDwz3D4ErQ4Xhy35dsSDvF+RA/tWpjyU0pdGtSDiEk6B5fBGE1qNVhw==}
+ resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==}
- resolution: {integrity: sha512-cOKPRFCWvHcYPJQAHN6V7Jp/wAfnyqQRXQ+2fgWIL6Gao20rpu7xQ1cGGo1APOfmbQmmHngEPg9Fy7nJ3giRkQ==}
+ resolution: {integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==}
+
+ resolution: {integrity: sha512-VzJhB4iyZ04w99HreEvXJY/lxzApnE/PRbcFY4cKnOUSRVbRbAf0AIU0DeavrkffW+mclJlkmnQYn9NdwcBk1g==}
engines: {node: '>=18'}
hasBin: true
- resolution: {integrity: sha512-QkikB2X5voO1okL3QsES0N690Sn/K9WokXqUsDQsWy5SnYb+psYQFGA10iy1bZHj3fjISKsI67Q90gruvWWM3A==}
+ resolution: {integrity: sha512-750hTRvgBy5kcMNPdh95Qo+XUBeGo8C7nsKSmedDmaQI+E0r82DwHeM6vBewDe4rGFbnxoa4V9pw+sPh5+Iz8Q==}
peerDependencies:
magicast: '*'
peerDependenciesMeta:
@@ -706,17 +1185,49 @@ packages:
resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==}
+ resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
+
+ resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==}
engines: {node: '>=18'}
+ resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==}
+
+ resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==}
+
+ resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==}
+
+ resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==}
+
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
engines: {node: '>= 14.16.0'}
+ resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==}
+ engines: {node: '>= 20.19.0'}
+
resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==}
+ resolution: {integrity: sha512-8csy5IBFI2ex2hTVpaHN2j+LNE199AgiI7y4dMintrr8i0lQiFn+0AWMZrWdHKIgMOer65f8IThysYhoReqjWA==}
+
+ resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
+
+ resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
+
resolution: {integrity: sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==}
@@ -728,6 +1239,9 @@ packages:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
+ resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
+
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
engines: {node: '>=6.0'}
@@ -737,14 +1251,27 @@ packages:
supports-color:
optional: true
+ resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==}
+
resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
+ resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==}
- resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==}
+ resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==}
+
+ resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
+
+ resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==}
engines: {node: '>=0.3.1'}
@@ -768,11 +1295,15 @@ packages:
resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==}
engines: {node: '>=14'}
+ resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
+ engines: {node: '>=0.12'}
+
resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}
- resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==}
+ resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==}
engines: {node: '>=18'}
hasBin: true
@@ -780,19 +1311,29 @@ packages:
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
engines: {node: '>=6'}
+ resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==}
+
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==}
- resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==}
+ resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==}
engines: {node: '>=12.0.0'}
resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==}
+ resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
+
resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
engines: {node: '>=12.0.0'}
@@ -802,25 +1343,71 @@ packages:
picomatch:
optional: true
+ resolution: {integrity: sha512-Tnd0FU05zGRFI3JJmBegXonF1rfuzYeuXd1QSdQ99Ysnppk0yWBWSW2wUsqzRpS5nv0zPNx+y0wtDj4kf0q5RQ==}
+ peerDependencies:
+ '@emotion/is-prop-valid': '*'
+ react: ^18.0.0 || ^19.0.0
+ react-dom: ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ '@emotion/is-prop-valid':
+ optional: true
+ react:
+ optional: true
+ react-dom:
+ optional: true
+
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
- resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==}
+ resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-EoY1N2xCn44xU6750Sx7OjOIT59FkmstNc3X6y5xpz7D5cBtZRe/3pSlTkDJgqsOk3WwZPkWfonhhUJfttQo3w==}
resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==}
hasBin: true
- resolution: {integrity: sha512-QsCdAUHAmiDeKeaNojb1OHOPF7NjcWPBR7obdu3NwH2a/oyQaLg5d0aaCy/9My6CdPChYF07dvz5chaXBGaD4g==}
+ resolution: {integrity: sha512-VQe+Q5CYiGOgcCERXhcfNsbnrN92FDEKciMH/x6LppU9dd0j4aTjCTlqONFOIMcAm/5JxS3+utowbXV1OoFr+g==}
engines: {node: '>=20.0.0'}
+ resolution: {integrity: sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==}
+
+ resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==}
+
resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==}
+ resolution: {integrity: sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ==}
+
+ resolution: {integrity: sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==}
+
+ resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==}
+
+ resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==}
+
+ resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==}
+
+ resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==}
+
+ resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
@@ -836,9 +1423,178 @@ packages:
resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==}
+ resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==}
+
+ resolution: {integrity: sha512-LQrH7jlkigIIv++wIyrOYFLHSKQpEY4zehPicL9bQsrt1rnoKRYCYgpCUe5maqylNtacy58/sQDZTkwMcTRxZw==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+
+ resolution: {integrity: sha512-+gfBXl6sxXMPe8tKQm7qzLnUy5DUPJPKIyRHwtpCpyUEYjHYRJC/5gjUvdkuO2c3JllrPtHXH5UJJK8LRYl5yQ==}
+
+ resolution: {integrity: sha512-rpp7pFHh3Xd93KHixNgB0SqThMHpYNzsGUu69UaQbSZ75Q/J3m5t6EhKyMT3m4w2WOxmJ2mY0tD3vebnXqQryQ==}
+ peerDependencies:
+ react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
+
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
+ resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==}
+
+ resolution: {integrity: sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==}
+
+ resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==}
+
+ resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==}
+
+ resolution: {integrity: sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==}
+
+ resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==}
+
+ resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==}
+
+ resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==}
+
+ resolution: {integrity: sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==}
+
+ resolution: {integrity: sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==}
+
+ resolution: {integrity: sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==}
+
+ resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==}
+
+ resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==}
+
+ resolution: {integrity: sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==}
+
+ resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==}
+
+ resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==}
+
+ resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==}
+
+ resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==}
+
+ resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==}
+
+ resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==}
+
+ resolution: {integrity: sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==}
+
+ resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==}
+
+ resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==}
+
+ resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==}
+
+ resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==}
+
+ resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==}
+
+ resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==}
+
+ resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==}
+
+ resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==}
+
+ resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==}
+
+ resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==}
+
+ resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==}
+
+ resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==}
+
+ resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==}
+
+ resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==}
+
+ resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==}
+
+ resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==}
+
+ resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==}
+
+ resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==}
+
+ resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==}
+
+ resolution: {integrity: sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==}
+
+ resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==}
+
+ resolution: {integrity: sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==}
+
+ resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==}
+
+ resolution: {integrity: sha512-QXB+iFJRzZTqL+Am4a1CRoHdH+0Nq12wLdqQQZZsfHlp9AMt6PA098L/61oVZsDA+Ep3QSGudzpViyRrhYhGcQ==}
+
+ resolution: {integrity: sha512-G3kc34H2cX2gI63RqU+cZq+zWRRPSsNIOjpdl9TN4AQwC4sgwYPl/Q/Obf/d53nOm569T0fYK+tcoSV50BWx8A==}
+
+ resolution: {integrity: sha512-KpZQik3LLFdsiaLdFXQGnty84KcDvvdvBCHSvA9aH+RjQTP6jkJGyngRPSngau13ARUI6TbPphf/Vv/QxwxRJQ==}
+ peerDependencies:
+ '@emotion/is-prop-valid': '*'
+ react: ^18.0.0 || ^19.0.0
+ react-dom: ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ '@emotion/is-prop-valid':
+ optional: true
+ react:
+ optional: true
+ react-dom:
+ optional: true
+
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@@ -850,9 +1606,9 @@ packages:
resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==}
- resolution: {integrity: sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g==}
- engines: {node: ^14.16.0 || >=16.10.0}
+ resolution: {integrity: sha512-1TvCKjZyyklN+JJj2TS3P4uSQEInrM/HkkuSXsEzm1ApPgBffOn8gFguNnZf07r/1X6vlryfIqMUkJKQMzlZiw==}
+ engines: {node: '>=18'}
hasBin: true
@@ -865,8 +1621,11 @@ packages:
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
engines: {node: '>=14.0.0'}
- resolution: {integrity: sha512-uBj69dVlYe/+wxj8JOpr97XfsxH/eumMt6HqjNTmJDf/6NO9s+0uxeOneIz3AsPt2m6y9PqzDzd3ATcU17MNfw==}
+ resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==}
+
+ resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==}
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
@@ -883,8 +1642,8 @@ packages:
resolution: {integrity: sha512-viMUCPDL6CSfOu0ZqVcFqbWRXNHIbv2lPqNbrBIjbFYrflebOjItJ4hPfhjnuUCstqciHVu9vVJ7jFqqKi/EuQ==}
engines: {node: '>= 14'}
- resolution: {integrity: sha512-fkEH/OBiKrqqI/yIgjR92lMfs2K8105zt/VT6+7eTjNwisrsh47CeIED9z58zI7DfKdH3uHAn25ziRZn3kgAow==}
+ resolution: {integrity: sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g==}
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -896,8 +1655,8 @@ packages:
resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==}
- resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==}
+ resolution: {integrity: sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==}
resolution: {integrity: sha512-8OEwKp5juEvb/MjpIc4hjqfgCNysrS94RIOMXYvpYCdm/jglrKEiAYmiumbmGhCvs+IcInsphYDFwqrjr7398w==}
@@ -910,20 +1669,23 @@ packages:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
- resolution: {integrity: sha512-NbqZMCwHectzfeFOeLqes1fPg/V5bsKhrBfyH1qHEcDb4ZHcbDARcqLE6JDhwMDQKa4YHkInXHITYscMuPylFw==}
- engines: {node: '>=20'}
+ resolution: {integrity: sha512-C4ueZUrifTJMDFngybSWQ+GthcqCqPiCcGg5qnjoh+f6ie3+tdhFROqqshjttpQ6Q4DPM40USPTmU/UBYqgsbA==}
+ engines: {node: ^20.20.0 || >=22.22.0}
- resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
+ resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==}
engines: {node: '>=14'}
hasBin: true
resolution: {integrity: sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==}
- resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==}
+ resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==}
+
+ resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==}
resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}
@@ -931,14 +1693,75 @@ packages:
resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==}
+ resolution: {integrity: sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==}
+ peerDependencies:
+ react: ^19.2.4
+
+ resolution: {integrity: sha512-xaijuJB0kzGiUdG7nc2MOMDUDBWPyGAjZtUrow9XxUeua8IqeP+VlIfAZ3bphpcLTnSZXz6z9jcVC/TCwbfgdw==}
+ peerDependencies:
+ '@types/react': '>=18'
+ react: '>=18'
+
+ resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ resolution: {integrity: sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ resolution: {integrity: sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ resolution: {integrity: sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
engines: {node: '>= 14.18.0'}
+ resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}
+ engines: {node: '>= 20.19.0'}
+
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
engines: {node: '>= 12.13.0'}
+ resolution: {integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==}
+
+ resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==}
+
+ resolution: {integrity: sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==}
+
+ resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==}
+
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
@@ -983,13 +1806,13 @@ packages:
'@oxc-project/runtime':
optional: true
- resolution: {integrity: sha512-M3AeZjYE6UclblEf531Hch0WfVC/NOL43Cc+WdF3J50kk5/fvouHhDumSGTh0oRjbZ8C4faaVr5r6Nx1xMqDGg==}
+ resolution: {integrity: sha512-Po/YZECDOqVXjIXrtC5h++a5NLvKAQNrd9ggrIG3sbDfGO5BqTUsrI6l8zdniKRp3r5Tp/2JTrXqx4GIguFCMw==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
- resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==}
+ resolution: {integrity: sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
@@ -997,6 +1820,9 @@ packages:
resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==}
engines: {node: '>=10'}
+ resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==}
+
resolution: {integrity: sha512-lwsAIzOPlH8/7IIjjz3K0zYBk7aBVVcvjMwt3M4fLxpjMYyy7i3I97SLHebgn4YBjirkzfp3RvRDWSKsh/+WFw==}
@@ -1023,6 +1849,9 @@ packages:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
engines: {node: '>=0.10.0'}
+ resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}
+
resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}
engines: {node: '>= 10.x'}
@@ -1033,15 +1862,24 @@ packages:
resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==}
+ resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==}
+
+ resolution: {integrity: sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==}
+
+ resolution: {integrity: sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==}
+
+ resolution: {integrity: sha512-Oo6tHdpZsGpkKG88HJ8RR1rg/RdnEkQEfMoEk2x1XRI3F1AxeU+ijRXpiVUF4UbLfcxxRGw6TbUINKYdWVsQTQ==}
+
resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==}
resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
- resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}
-
resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==}
engines: {node: '>=18'}
@@ -1058,6 +1896,12 @@ packages:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
+ resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}
+
+ resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==}
+
resolution: {integrity: sha512-VSfoNm8MJXFdg7PJ4p2javgjMRiQQHpkP9N3iBBTrmCixcT6YZ9ZtqYMW3NDHczqR0C0Qnur1HMQr1ZfZcmrng==}
engines: {node: '>=18.0.0'}
@@ -1102,8 +1946,8 @@ packages:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
- resolution: {integrity: sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==}
+ resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==}
engines: {node: '>=18.0.0'}
hasBin: true
@@ -1112,21 +1956,65 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
- resolution: {integrity: sha512-Bp/bPZjV2Vl/fofoA2OYLSnw1Z0MOhCX7zHnVCYrazpfZvseBbGhwcNQMxsg185Mqh7VZQqK3C8hFG/Dyng+yA==}
+ resolution: {integrity: sha512-VgPCvLWugINbXvMQDf8Jh0mlbvNjNC6eSUziHsBCMpxR05OPrNrvDnyatdMjRgcHaaNsCqz+wjNXxNw1kRLHUg==}
- resolution: {integrity: sha512-uyQ7LElcGizrOGZyIq9KU+xkuEjcRf9IpmDTkCSYv5mEeZzrXSj6rb51C0L+WTedsmAoVxW9WKrLWhSwebIM9Q==}
+ resolution: {integrity: sha512-nrMlWRQ1xdTjSnSUqvYqJzbTBFugoqHobQj58B2bc8qxHKBBHMNNsWQFP3Cd3/JZK907voM2geYPWqD4VK3MPQ==}
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
+ resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==}
+
+ resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==}
+
+ resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==}
+
+ resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==}
+
+ resolution: {integrity: sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==}
+
+ resolution: {integrity: sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==}
+
+ resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ resolution: {integrity: sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==}
hasBin: true
- resolution: {integrity: sha512-tI2l/nFHC5rLh7+5+o7QjKjSR04ivXDF4jcgV0f/bTQ+OJiITy5S6gaynVsEM+7RqzufMnVbIon6Sr5x1SDYaQ==}
+ resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==}
+
+ resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
+
+ resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
@@ -1165,18 +2053,18 @@ packages:
yaml:
optional: true
- resolution: {integrity: sha512-d9B2J9Cm9dN9+6nxMnnNJKJCtcyKfnHj15N6YNJfaFHRLua/d3sRKU9RuKmO9mB0XdFtUizlxfz/VPbd3OxGhw==}
+ resolution: {integrity: sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ==}
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
'@opentelemetry/api': ^1.9.0
'@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
- '@vitest/browser-playwright': 4.0.14
- '@vitest/browser-preview': 4.0.14
- '@vitest/browser-webdriverio': 4.0.14
- '@vitest/ui': 4.0.14
+ '@vitest/browser-playwright': 4.0.18
+ '@vitest/browser-preview': 4.0.18
+ '@vitest/browser-webdriverio': 4.0.18
+ '@vitest/ui': 4.0.18
happy-dom: '*'
jsdom: '*'
peerDependenciesMeta:
@@ -1217,8 +2105,8 @@ packages:
engines: {node: '>=8'}
hasBin: true
- resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}
+ resolution: {integrity: sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@@ -1229,16 +2117,14 @@ packages:
utf-8-validate:
optional: true
- resolution: {integrity: sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==}
- engines: {node: '>= 14.6'}
- hasBin: true
-
resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==}
engines: {node: '>= 14.6'}
hasBin: true
+ resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
+
onlyBuiltDependencies:
- esbuild
- protobufjs
@@ -1247,10 +2133,10 @@ onlyBuiltDependencies:
snapshots:
- '@babel/[email protected]':
+ '@babel/[email protected]':
dependencies:
- '@babel/parser': 7.28.5
- '@babel/types': 7.28.5
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.0
'@jridgewell/gen-mapping': 0.3.13
'@jridgewell/trace-mapping': 0.3.31
jsesc: 3.1.0
@@ -1259,22 +2145,22 @@ snapshots:
'@babel/[email protected]': {}
- '@babel/[email protected]':
+ '@babel/[email protected]':
dependencies:
- '@babel/types': 7.28.5
+ '@babel/types': 7.29.0
- '@babel/[email protected]':
+ '@babel/[email protected]':
dependencies:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5
- '@emnapi/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
'@emnapi/wasi-threads': 1.1.0
tslib: 2.8.1
optional: true
- '@emnapi/[email protected]':
+ '@emnapi/[email protected]':
dependencies:
tslib: 2.8.1
optional: true
@@ -1284,84 +2170,101 @@ snapshots:
tslib: 2.8.1
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
- '@esbuild/[email protected]':
+ '@esbuild/[email protected]':
optional: true
+ '@floating-ui/[email protected]':
+ dependencies:
+ '@floating-ui/utils': 0.2.10
+
+ '@floating-ui/[email protected]':
+ dependencies:
+ '@floating-ui/core': 1.7.4
+ '@floating-ui/utils': 0.2.10
+
+ dependencies:
+ '@floating-ui/dom': 1.7.5
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ '@floating-ui/[email protected]': {}
+
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
@@ -1380,84 +2283,389 @@ snapshots:
'@napi-rs/[email protected]':
dependencies:
- '@emnapi/core': 1.7.1
- '@emnapi/runtime': 1.7.1
+ '@emnapi/core': 1.8.1
+ '@emnapi/runtime': 1.8.1
'@tybys/wasm-util': 0.10.1
optional: true
'@napi-rs/[email protected]':
dependencies:
- '@emnapi/core': 1.7.1
- '@emnapi/runtime': 1.7.1
+ '@emnapi/core': 1.8.1
+ '@emnapi/runtime': 1.8.1
'@tybys/wasm-util': 0.10.1
optional: true
- '@oxc-project/[email protected]': {}
+ '@oxc-project/[email protected]': {}
'@oxc-project/[email protected]': {}
'@pinojs/[email protected]': {}
- '@posthog/[email protected]':
+ '@posthog/[email protected]':
dependencies:
cross-spawn: 7.0.6
- '@quansync/[email protected]':
+ '@quansync/[email protected]':
+ dependencies:
+ quansync: 1.0.0
+
+ '@radix-ui/[email protected]': {}
+
+ '@radix-ui/[email protected]': {}
+
dependencies:
- quansync: 0.2.11
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.1.3(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-portal': 1.1.9(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.1.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ aria-hidden: 1.2.6
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ react-remove-scroll: 2.7.2(@types/[email protected])([email protected])
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-escape-keydown': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-menu': 2.1.16(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-collection': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.1.3(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.2.8(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.1.9(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.1.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-roving-focus': 1.1.11(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ aria-hidden: 1.2.6
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ react-remove-scroll: 2.7.2(@types/[email protected])([email protected])
+
+ dependencies:
+ '@floating-ui/react-dom': 2.1.7([email protected])([email protected])
+ '@radix-ui/react-arrow': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-rect': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-size': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/rect': 1.1.1
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-collection': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@radix-ui/number': 1.1.1
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-collection': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-focus-guards': 1.1.3(@types/[email protected])([email protected])
+ '@radix-ui/react-focus-scope': 1.1.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.2.8(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.1.9(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-use-previous': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-visually-hidden': 1.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ aria-hidden: 1.2.6
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ react-remove-scroll: 2.7.2(@types/[email protected])([email protected])
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/primitive': 1.1.3
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
+ '@radix-ui/react-popper': 1.2.8(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-portal': 1.1.9(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-presence': 1.1.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
+ '@radix-ui/react-visually-hidden': 1.2.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-use-effect-event': 0.0.2(@types/[email protected])([email protected])
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/rect': 1.1.1
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-use-layout-effect': 1.1.1(@types/[email protected])([email protected])
+ '@types/react': 18.3.27
+ react: 19.2.4
+
+ dependencies:
+ '@radix-ui/react-primitive': 2.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])
+ '@types/react': 18.3.27
+ '@types/react-dom': 18.3.7(@types/[email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+ '@radix-ui/[email protected]': {}
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
@@ -1465,7 +2673,7 @@ snapshots:
'@napi-rs/wasm-runtime': 0.2.12
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
dependencies:
'@napi-rs/wasm-runtime': 1.1.1
optional: true
@@ -1473,7 +2681,7 @@ snapshots:
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]':
@@ -1482,87 +2690,89 @@ snapshots:
'@rolldown/[email protected]':
optional: true
- '@rolldown/[email protected]':
+ '@rolldown/[email protected]':
optional: true
'@rolldown/[email protected]': {}
- '@rolldown/[email protected]': {}
+ '@rolldown/[email protected]': {}
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@rollup/[email protected]':
+ '@rollup/[email protected]':
optional: true
- '@standard-schema/[email protected]': {}
+ '@rollup/[email protected]':
+ optional: true
- '@trycua/[email protected]':
- dependencies:
- '@types/uuid': 10.0.0
- pino: 9.14.0
- posthog-node: 5.14.1
- uuid: 11.1.0
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@standard-schema/[email protected]': {}
dependencies:
@@ -1574,99 +2784,137 @@ snapshots:
'@types/deep-eql': 4.0.2
assertion-error: 2.0.1
+ '@types/[email protected]':
+ dependencies:
+ '@types/ms': 2.1.0
+
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/estree': 1.0.8
+
'@types/[email protected]': {}
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
- undici-types: 6.21.0
+ '@types/unist': 3.0.3
- '@types/[email protected]':
+ '@types/[email protected]':
+ dependencies:
+ '@types/unist': 3.0.3
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
dependencies:
undici-types: 6.21.0
+ '@types/[email protected]': {}
+
+ dependencies:
+ '@types/react': 18.3.27
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/prop-types': 15.7.15
+ csstype: 3.2.3
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
'@types/[email protected]': {}
dependencies:
- '@types/node': 22.19.1
+ '@types/node': 22.19.8
- '@vitest/[email protected]':
+ '@ungap/[email protected]': {}
+
+ '@vitest/[email protected]':
dependencies:
- '@standard-schema/spec': 1.0.0
+ '@standard-schema/spec': 1.1.0
'@types/chai': 5.2.3
- '@vitest/spy': 4.0.14
- '@vitest/utils': 4.0.14
- chai: 6.2.1
+ '@vitest/spy': 4.0.18
+ '@vitest/utils': 4.0.18
+ chai: 6.2.2
tinyrainbow: 3.0.3
dependencies:
- '@vitest/spy': 4.0.14
+ '@vitest/spy': 4.0.18
estree-walker: 3.0.3
magic-string: 0.30.21
- optionalDependencies:
+ vite: 7.3.1(@types/[email protected])([email protected])
- '@vitest/[email protected]':
+ '@vitest/[email protected]':
dependencies:
tinyrainbow: 3.0.3
- '@vitest/[email protected]':
+ '@vitest/[email protected]':
dependencies:
- '@vitest/utils': 4.0.14
+ '@vitest/utils': 4.0.18
pathe: 2.0.3
- '@vitest/[email protected]':
+ '@vitest/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.0.14
+ '@vitest/pretty-format': 4.0.18
magic-string: 0.30.21
pathe: 2.0.3
- '@vitest/[email protected]': {}
+ '@vitest/[email protected]': {}
- '@vitest/[email protected]':
+ '@vitest/[email protected]':
dependencies:
- '@vitest/pretty-format': 4.0.14
+ '@vitest/pretty-format': 4.0.18
tinyrainbow: 3.0.3
+ '@zip.js/[email protected]': {}
+
+ dependencies:
+ tslib: 2.8.1
+
dependencies:
- '@babel/parser': 7.28.5
+ '@babel/parser': 7.29.0
pathe: 2.0.3
+
dependencies:
ansis: 4.2.0
args-tokenizer: 0.3.0
- c12: 3.3.2
+ c12: 3.3.3
cac: 6.7.14
escalade: 3.2.0
jsonc-parser: 3.3.1
- package-manager-detector: 1.5.0
+ package-manager-detector: 1.6.0
semver: 7.7.3
tinyexec: 1.0.2
tinyglobby: 0.2.15
- yaml: 2.8.1
+ yaml: 2.8.2
transitivePeerDependencies:
- magicast
dependencies:
- chokidar: 4.0.3
+ chokidar: 5.0.0
confbox: 0.2.2
defu: 6.1.4
dotenv: 17.2.3
@@ -1675,22 +2923,46 @@ snapshots:
jiti: 2.6.1
ohash: 2.0.11
pathe: 2.0.3
- perfect-debounce: 2.0.0
+ perfect-debounce: 2.1.0
pkg-types: 2.3.0
rc9: 2.1.2
+
+
+
+
+
dependencies:
readdirp: 4.1.2
+ dependencies:
+ readdirp: 5.0.0
+
dependencies:
consola: 3.4.2
+
+ dependencies:
+ clsx: 2.1.1
+
+
+
@@ -1701,15 +2973,29 @@ snapshots:
shebang-command: 2.0.0
which: 2.0.2
+
dependencies:
ms: 2.1.3
+ dependencies:
+ character-entities: 2.0.2
+
+
+
+ dependencies:
+ dequal: 2.0.3
+
@@ -1719,57 +3005,75 @@ snapshots:
+
optionalDependencies:
- '@esbuild/aix-ppc64': 0.25.12
- '@esbuild/android-arm': 0.25.12
- '@esbuild/android-arm64': 0.25.12
- '@esbuild/android-x64': 0.25.12
- '@esbuild/darwin-arm64': 0.25.12
- '@esbuild/darwin-x64': 0.25.12
- '@esbuild/freebsd-arm64': 0.25.12
- '@esbuild/freebsd-x64': 0.25.12
- '@esbuild/linux-arm': 0.25.12
- '@esbuild/linux-arm64': 0.25.12
- '@esbuild/linux-ia32': 0.25.12
- '@esbuild/linux-loong64': 0.25.12
- '@esbuild/linux-mips64el': 0.25.12
- '@esbuild/linux-ppc64': 0.25.12
- '@esbuild/linux-riscv64': 0.25.12
- '@esbuild/linux-s390x': 0.25.12
- '@esbuild/linux-x64': 0.25.12
- '@esbuild/netbsd-arm64': 0.25.12
- '@esbuild/netbsd-x64': 0.25.12
- '@esbuild/openbsd-arm64': 0.25.12
- '@esbuild/openbsd-x64': 0.25.12
- '@esbuild/openharmony-arm64': 0.25.12
- '@esbuild/sunos-x64': 0.25.12
- '@esbuild/win32-arm64': 0.25.12
- '@esbuild/win32-ia32': 0.25.12
- '@esbuild/win32-x64': 0.25.12
+ '@esbuild/aix-ppc64': 0.27.2
+ '@esbuild/android-arm': 0.27.2
+ '@esbuild/android-arm64': 0.27.2
+ '@esbuild/android-x64': 0.27.2
+ '@esbuild/darwin-arm64': 0.27.2
+ '@esbuild/darwin-x64': 0.27.2
+ '@esbuild/freebsd-arm64': 0.27.2
+ '@esbuild/freebsd-x64': 0.27.2
+ '@esbuild/linux-arm': 0.27.2
+ '@esbuild/linux-arm64': 0.27.2
+ '@esbuild/linux-ia32': 0.27.2
+ '@esbuild/linux-loong64': 0.27.2
+ '@esbuild/linux-mips64el': 0.27.2
+ '@esbuild/linux-ppc64': 0.27.2
+ '@esbuild/linux-riscv64': 0.27.2
+ '@esbuild/linux-s390x': 0.27.2
+ '@esbuild/linux-x64': 0.27.2
+ '@esbuild/netbsd-arm64': 0.27.2
+ '@esbuild/netbsd-x64': 0.27.2
+ '@esbuild/openbsd-arm64': 0.27.2
+ '@esbuild/openbsd-x64': 0.27.2
+ '@esbuild/openharmony-arm64': 0.27.2
+ '@esbuild/sunos-x64': 0.27.2
+ '@esbuild/win32-arm64': 0.27.2
+ '@esbuild/win32-ia32': 0.27.2
+ '@esbuild/win32-x64': 0.27.2
+
+
dependencies:
'@types/estree': 1.0.8
+
- optionalDependencies:
+ dependencies:
picomatch: 4.0.3
+ dependencies:
+ motion-dom: 12.30.1
+ motion-utils: 12.29.2
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ tslib: 2.8.1
+
optional: true
+
dependencies:
resolve-pkg-maps: 1.0.0
@@ -1779,17 +3083,64 @@ snapshots:
consola: 3.4.2
defu: 6.1.4
node-fetch-native: 1.6.7
- nypm: 0.6.2
+ nypm: 0.6.4
pathe: 2.0.3
dependencies:
- '@types/node': 20.19.25
+ '@types/node': 22.19.8
'@types/whatwg-mimetype': 3.0.2
+ '@types/ws': 8.18.1
+ entities: 4.5.0
whatwg-mimetype: 3.0.0
+ ws: 8.19.0
+ transitivePeerDependencies:
+ - bufferutil
+ - utf-8-validate
+
+ dependencies:
+ '@types/estree': 1.0.8
+ '@types/hast': 3.0.4
+ '@types/unist': 3.0.3
+ comma-separated-tokens: 2.0.3
+ devlop: 1.1.0
+ estree-util-is-identifier-name: 3.0.0
+ hast-util-whitespace: 3.0.0
+ mdast-util-mdx-expression: 2.0.1
+ mdast-util-mdx-jsx: 3.2.0
+ mdast-util-mdxjs-esm: 2.0.1
+ property-information: 7.1.0
+ space-separated-tokens: 2.0.2
+ style-to-js: 1.1.21
+ unist-util-position: 5.0.0
+ vfile-message: 4.0.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/hast': 3.0.4
+
+
+
+ dependencies:
+ is-alphabetical: 2.0.1
+ is-decimal: 2.0.1
+
+
+
+
@@ -1798,22 +3149,393 @@ snapshots:
+
+ dependencies:
+ lottie-web: 5.13.0
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+
+
+ dependencies:
+ react: 19.2.4
+
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ escape-string-regexp: 5.0.0
+ unist-util-is: 6.0.1
+ unist-util-visit-parents: 6.0.2
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ '@types/unist': 3.0.3
+ decode-named-character-reference: 1.3.0
+ devlop: 1.1.0
+ mdast-util-to-string: 4.0.0
+ micromark: 4.0.2
+ micromark-util-decode-numeric-character-reference: 2.0.2
+ micromark-util-decode-string: 2.0.1
+ micromark-util-normalize-identifier: 2.0.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+ unist-util-stringify-position: 4.0.0
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ ccount: 2.0.1
+ devlop: 1.1.0
+ mdast-util-find-and-replace: 3.0.2
+ micromark-util-character: 2.1.1
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ devlop: 1.1.0
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ micromark-util-normalize-identifier: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ devlop: 1.1.0
+ markdown-table: 3.0.4
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ devlop: 1.1.0
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-gfm-autolink-literal: 2.0.1
+ mdast-util-gfm-footnote: 2.1.0
+ mdast-util-gfm-strikethrough: 2.0.0
+ mdast-util-gfm-table: 2.0.0
+ mdast-util-gfm-task-list-item: 2.0.0
+ mdast-util-to-markdown: 2.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/estree-jsx': 1.0.5
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
+ devlop: 1.1.0
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/estree-jsx': 1.0.5
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
+ '@types/unist': 3.0.3
+ ccount: 2.0.1
+ devlop: 1.1.0
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ parse-entities: 4.0.2
+ stringify-entities: 4.0.4
+ unist-util-stringify-position: 4.0.0
+ vfile-message: 4.0.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/estree-jsx': 1.0.5
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
+ devlop: 1.1.0
+ mdast-util-from-markdown: 2.0.2
+ mdast-util-to-markdown: 2.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ unist-util-is: 6.0.1
+
+ dependencies:
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
+ '@ungap/structured-clone': 1.3.0
+ devlop: 1.1.0
+ micromark-util-sanitize-uri: 2.0.1
+ trim-lines: 3.0.1
+ unist-util-position: 5.0.0
+ unist-util-visit: 5.1.0
+ vfile: 6.0.3
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ '@types/unist': 3.0.3
+ longest-streak: 3.1.0
+ mdast-util-phrasing: 4.1.0
+ mdast-util-to-string: 4.0.0
+ micromark-util-classify-character: 2.0.1
+ micromark-util-decode-string: 2.0.1
+ unist-util-visit: 5.1.0
+ zwitch: 2.0.4
+
+ dependencies:
+ '@types/mdast': 4.0.4
+
+ dependencies:
+ decode-named-character-reference: 1.3.0
+ devlop: 1.1.0
+ micromark-factory-destination: 2.0.1
+ micromark-factory-label: 2.0.1
+ micromark-factory-space: 2.0.1
+ micromark-factory-title: 2.0.1
+ micromark-factory-whitespace: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-chunked: 2.0.1
+ micromark-util-classify-character: 2.0.1
+ micromark-util-html-tag-name: 2.0.1
+ micromark-util-normalize-identifier: 2.0.1
+ micromark-util-resolve-all: 2.0.1
+ micromark-util-subtokenize: 2.1.0
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-character: 2.1.1
+ micromark-util-sanitize-uri: 2.0.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ devlop: 1.1.0
+ micromark-core-commonmark: 2.0.3
+ micromark-factory-space: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-normalize-identifier: 2.0.1
+ micromark-util-sanitize-uri: 2.0.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ devlop: 1.1.0
+ micromark-util-chunked: 2.0.1
+ micromark-util-classify-character: 2.0.1
+ micromark-util-resolve-all: 2.0.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ devlop: 1.1.0
+ micromark-factory-space: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ devlop: 1.1.0
+ micromark-factory-space: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-extension-gfm-autolink-literal: 2.1.0
+ micromark-extension-gfm-footnote: 2.1.0
+ micromark-extension-gfm-strikethrough: 2.1.0
+ micromark-extension-gfm-table: 2.1.1
+ micromark-extension-gfm-tagfilter: 2.0.0
+ micromark-extension-gfm-task-list-item: 2.1.0
+ micromark-util-combine-extensions: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ devlop: 1.1.0
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-character: 2.1.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-factory-space: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-factory-space: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-symbol: 2.0.1
+
+ dependencies:
+ micromark-util-character: 2.1.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-chunked: 2.0.1
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-symbol: 2.0.1
+
+ dependencies:
+ decode-named-character-reference: 1.3.0
+ micromark-util-character: 2.1.1
+ micromark-util-decode-numeric-character-reference: 2.0.2
+ micromark-util-symbol: 2.0.1
+
+
+
+ dependencies:
+ micromark-util-symbol: 2.0.1
+
+ dependencies:
+ micromark-util-types: 2.0.2
+
+ dependencies:
+ micromark-util-character: 2.1.1
+ micromark-util-encode: 2.0.1
+ micromark-util-symbol: 2.0.1
+
+ dependencies:
+ devlop: 1.1.0
+ micromark-util-chunked: 2.0.1
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+
+
+
+ dependencies:
+ '@types/debug': 4.1.12
+ debug: 4.4.3
+ decode-named-character-reference: 1.3.0
+ devlop: 1.1.0
+ micromark-core-commonmark: 2.0.3
+ micromark-factory-space: 2.0.1
+ micromark-util-character: 2.1.1
+ micromark-util-chunked: 2.0.1
+ micromark-util-combine-extensions: 2.0.1
+ micromark-util-decode-numeric-character-reference: 2.0.2
+ micromark-util-encode: 2.0.1
+ micromark-util-normalize-identifier: 2.0.1
+ micromark-util-resolve-all: 2.0.1
+ micromark-util-sanitize-uri: 2.0.1
+ micromark-util-subtokenize: 2.1.0
+ micromark-util-symbol: 2.0.1
+ micromark-util-types: 2.0.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ motion-utils: 12.29.2
+
+
+ dependencies:
+ framer-motion: 12.31.0([email protected])([email protected])
+ react: 19.2.4
+ react-dom: 19.2.4([email protected])
+ tslib: 2.8.1
+
dependencies:
- citty: 0.1.6
- consola: 3.4.2
+ citty: 0.2.0
pathe: 2.0.3
- pkg-types: 2.3.0
tinyexec: 1.0.2
@@ -1822,7 +3544,17 @@ snapshots:
+
+ dependencies:
+ '@types/unist': 2.0.11
+ character-entities-legacy: 3.0.0
+ character-reference-invalid: 2.0.1
+ decode-named-character-reference: 1.3.0
+ is-alphanumerical: 2.0.1
+ is-decimal: 2.0.1
+ is-hexadecimal: 2.0.1
@@ -1837,7 +3569,7 @@ snapshots:
peerjs-js-binarypack: 2.1.0
webrtc-adapter: 9.0.3
@@ -1847,7 +3579,7 @@ snapshots:
dependencies:
split2: 4.2.0
dependencies:
@@ -1855,7 +3587,7 @@ snapshots:
atomic-sleep: 1.0.0
on-exit-leak-free: 2.1.2
pino-abstract-transport: 2.0.0
- pino-std-serializers: 7.0.0
+ pino-std-serializers: 7.1.0
process-warning: 5.0.0
quick-format-unescaped: 4.0.4
real-require: 0.2.0
@@ -1875,15 +3607,17 @@ snapshots:
picocolors: 1.1.1
source-map-js: 1.2.1
dependencies:
- '@posthog/core': 1.6.0
+ '@posthog/core': 1.20.0
+
@@ -1892,41 +3626,124 @@ snapshots:
defu: 6.1.4
destr: 2.0.5
+ dependencies:
+ react: 19.2.4
+ scheduler: 0.27.0
+
+ dependencies:
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
+ '@types/react': 18.3.27
+ devlop: 1.1.0
+ hast-util-to-jsx-runtime: 2.3.6
+ html-url-attributes: 3.0.1
+ mdast-util-to-hast: 13.2.1
+ react: 19.2.4
+ remark-parse: 11.0.0
+ remark-rehype: 11.1.2
+ unified: 11.0.5
+ unist-util-visit: 5.1.0
+ vfile: 6.0.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+ react-style-singleton: 2.2.3(@types/[email protected])([email protected])
+ tslib: 2.8.1
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+ react-remove-scroll-bar: 2.3.8(@types/[email protected])([email protected])
+ react-style-singleton: 2.2.3(@types/[email protected])([email protected])
+ tslib: 2.8.1
+ use-callback-ref: 1.3.3(@types/[email protected])([email protected])
+ use-sidecar: 1.1.3(@types/[email protected])([email protected])
+
+ dependencies:
+ '@types/react': 18.3.27
+ get-nonce: 1.0.1
+ react: 19.2.4
+ tslib: 2.8.1
+
+
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ mdast-util-gfm: 3.1.0
+ micromark-extension-gfm: 3.0.0
+ remark-parse: 11.0.0
+ remark-stringify: 11.0.0
+ unified: 11.0.5
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ mdast-util-from-markdown: 2.0.2
+ micromark-util-types: 2.0.2
+ unified: 11.0.5
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@types/hast': 3.0.4
+ '@types/mdast': 4.0.4
+ mdast-util-to-hast: 13.2.1
+ unified: 11.0.5
+ vfile: 6.0.3
+
+ dependencies:
+ '@types/mdast': 4.0.4
+ mdast-util-to-markdown: 2.1.2
+ unified: 11.0.5
+
dependencies:
- '@babel/generator': 7.28.5
- '@babel/parser': 7.28.5
- '@babel/types': 7.28.5
+ '@babel/generator': 7.29.1
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.0
ast-kit: 2.2.0
- birpc: 2.8.0
+ birpc: 2.9.0
debug: 4.4.3
dts-resolver: 2.1.3
- get-tsconfig: 4.13.0
+ get-tsconfig: 4.13.1
rolldown: 1.0.0-beta.9
- optionalDependencies:
typescript: 5.9.3
transitivePeerDependencies:
- oxc-resolver
- supports-color
dependencies:
- '@babel/generator': 7.28.5
- '@babel/parser': 7.28.5
- '@babel/types': 7.28.5
+ '@babel/generator': 7.29.1
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.0
ast-kit: 2.2.0
- birpc: 2.8.0
+ birpc: 2.9.0
debug: 4.4.3
dts-resolver: 2.1.3
- get-tsconfig: 4.13.0
- rolldown: 1.0.0-rc.1
- optionalDependencies:
+ get-tsconfig: 4.13.1
+ rolldown: 1.0.0-rc.3
typescript: 5.9.3
transitivePeerDependencies:
- oxc-resolver
@@ -1951,55 +3768,60 @@ snapshots:
'@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.9
'@rolldown/binding-win32-x64-msvc': 1.0.0-beta.9
dependencies:
- '@oxc-project/types': 0.110.0
- '@rolldown/pluginutils': 1.0.0-rc.1
+ '@oxc-project/types': 0.112.0
+ '@rolldown/pluginutils': 1.0.0-rc.3
optionalDependencies:
- '@rolldown/binding-android-arm64': 1.0.0-rc.1
- '@rolldown/binding-darwin-arm64': 1.0.0-rc.1
- '@rolldown/binding-darwin-x64': 1.0.0-rc.1
- '@rolldown/binding-freebsd-x64': 1.0.0-rc.1
- '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.1
- '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.1
- '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.1
- '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.1
- '@rolldown/binding-linux-x64-musl': 1.0.0-rc.1
- '@rolldown/binding-openharmony-arm64': 1.0.0-rc.1
- '@rolldown/binding-wasm32-wasi': 1.0.0-rc.1
- '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.1
- '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.1
-
+ '@rolldown/binding-android-arm64': 1.0.0-rc.3
+ '@rolldown/binding-darwin-arm64': 1.0.0-rc.3
+ '@rolldown/binding-darwin-x64': 1.0.0-rc.3
+ '@rolldown/binding-freebsd-x64': 1.0.0-rc.3
+ '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.3
+ '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.3
+ '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.3
+ '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.3
+ '@rolldown/binding-linux-x64-musl': 1.0.0-rc.3
+ '@rolldown/binding-openharmony-arm64': 1.0.0-rc.3
+ '@rolldown/binding-wasm32-wasi': 1.0.0-rc.3
+ '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.3
+ '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.3
+
dependencies:
'@types/estree': 1.0.8
optionalDependencies:
- '@rollup/rollup-android-arm-eabi': 4.53.3
- '@rollup/rollup-android-arm64': 4.53.3
- '@rollup/rollup-darwin-arm64': 4.53.3
- '@rollup/rollup-darwin-x64': 4.53.3
- '@rollup/rollup-freebsd-arm64': 4.53.3
- '@rollup/rollup-freebsd-x64': 4.53.3
- '@rollup/rollup-linux-arm-gnueabihf': 4.53.3
- '@rollup/rollup-linux-arm-musleabihf': 4.53.3
- '@rollup/rollup-linux-arm64-gnu': 4.53.3
- '@rollup/rollup-linux-arm64-musl': 4.53.3
- '@rollup/rollup-linux-loong64-gnu': 4.53.3
- '@rollup/rollup-linux-ppc64-gnu': 4.53.3
- '@rollup/rollup-linux-riscv64-gnu': 4.53.3
- '@rollup/rollup-linux-riscv64-musl': 4.53.3
- '@rollup/rollup-linux-s390x-gnu': 4.53.3
- '@rollup/rollup-linux-x64-gnu': 4.53.3
- '@rollup/rollup-linux-x64-musl': 4.53.3
- '@rollup/rollup-openharmony-arm64': 4.53.3
- '@rollup/rollup-win32-arm64-msvc': 4.53.3
- '@rollup/rollup-win32-ia32-msvc': 4.53.3
- '@rollup/rollup-win32-x64-gnu': 4.53.3
- '@rollup/rollup-win32-x64-msvc': 4.53.3
+ '@rollup/rollup-android-arm-eabi': 4.57.1
+ '@rollup/rollup-android-arm64': 4.57.1
+ '@rollup/rollup-darwin-arm64': 4.57.1
+ '@rollup/rollup-darwin-x64': 4.57.1
+ '@rollup/rollup-freebsd-arm64': 4.57.1
+ '@rollup/rollup-freebsd-x64': 4.57.1
+ '@rollup/rollup-linux-arm-gnueabihf': 4.57.1
+ '@rollup/rollup-linux-arm-musleabihf': 4.57.1
+ '@rollup/rollup-linux-arm64-gnu': 4.57.1
+ '@rollup/rollup-linux-arm64-musl': 4.57.1
+ '@rollup/rollup-linux-loong64-gnu': 4.57.1
+ '@rollup/rollup-linux-loong64-musl': 4.57.1
+ '@rollup/rollup-linux-ppc64-gnu': 4.57.1
+ '@rollup/rollup-linux-ppc64-musl': 4.57.1
+ '@rollup/rollup-linux-riscv64-gnu': 4.57.1
+ '@rollup/rollup-linux-riscv64-musl': 4.57.1
+ '@rollup/rollup-linux-s390x-gnu': 4.57.1
+ '@rollup/rollup-linux-x64-gnu': 4.57.1
+ '@rollup/rollup-linux-x64-musl': 4.57.1
+ '@rollup/rollup-openbsd-x64': 4.57.1
+ '@rollup/rollup-openharmony-arm64': 4.57.1
+ '@rollup/rollup-win32-arm64-msvc': 4.57.1
+ '@rollup/rollup-win32-ia32-msvc': 4.57.1
+ '@rollup/rollup-win32-x64-gnu': 4.57.1
+ '@rollup/rollup-win32-x64-msvc': 4.57.1
fsevents: 2.3.3
+
@@ -2018,20 +3840,35 @@ snapshots:
+
+ dependencies:
+ character-entities-html4: 2.1.0
+ character-entities-legacy: 3.0.0
+
+ dependencies:
+ style-to-object: 1.0.14
+
+ dependencies:
+ inline-style-parser: 0.2.7
+
+
dependencies:
real-require: 0.2.0
-
@@ -2043,13 +3880,17 @@ snapshots:
+
+
dependencies:
ansis: 4.2.0
cac: 6.7.14
chokidar: 4.0.3
debug: 4.4.3
- diff: 8.0.2
+ diff: 8.0.3
empathic: 1.1.0
hookable: 5.5.3
rolldown: 1.0.0-beta.9
@@ -2057,9 +3898,8 @@ snapshots:
semver: 7.7.3
tinyexec: 1.0.2
tinyglobby: 0.2.15
- unconfig: 7.4.1
- optionalDependencies:
typescript: 5.9.3
+ unconfig: 7.4.2
transitivePeerDependencies:
- '@oxc-project/runtime'
- '@typescript/native-preview'
@@ -2073,93 +3913,144 @@ snapshots:
cac: 6.7.14
chokidar: 4.0.3
debug: 4.4.3
- diff: 8.0.2
+ diff: 8.0.3
empathic: 2.0.0
hookable: 5.5.3
- rolldown: 1.0.0-rc.1
- rolldown-plugin-dts: 0.15.10([email protected])([email protected])
+ rolldown: 1.0.0-rc.3
+ rolldown-plugin-dts: 0.15.10([email protected])([email protected])
semver: 7.7.3
tinyexec: 1.0.2
tinyglobby: 0.2.15
tree-kill: 1.2.2
- unconfig: 7.4.1
- optionalDependencies:
typescript: 5.9.3
+ unconfig: 7.4.2
transitivePeerDependencies:
- '@typescript/native-preview'
- oxc-resolver
- supports-color
- vue-tsc
- optional: true
dependencies:
- esbuild: 0.25.12
- get-tsconfig: 4.13.0
+ esbuild: 0.27.2
+ get-tsconfig: 4.13.1
optionalDependencies:
fsevents: 2.3.3
dependencies:
- '@quansync/fs': 0.1.5
- quansync: 0.2.11
+ '@quansync/fs': 1.0.0
+ quansync: 1.0.0
dependencies:
- '@quansync/fs': 0.1.5
+ '@quansync/fs': 1.0.0
defu: 6.1.4
jiti: 2.6.1
- quansync: 0.2.11
- unconfig-core: 7.4.1
+ quansync: 1.0.0
+ unconfig-core: 7.4.2
+ dependencies:
+ '@types/unist': 3.0.3
+ bail: 2.0.2
+ devlop: 1.1.0
+ extend: 3.0.2
+ is-plain-obj: 4.1.0
+ trough: 2.2.0
+ vfile: 6.0.3
+
+ dependencies:
+ '@types/unist': 3.0.3
+
+ dependencies:
+ '@types/unist': 3.0.3
+
+ dependencies:
+ '@types/unist': 3.0.3
+
+ dependencies:
+ '@types/unist': 3.0.3
+ unist-util-is: 6.0.1
+
+ dependencies:
+ '@types/unist': 3.0.3
+ unist-util-is: 6.0.1
+ unist-util-visit-parents: 6.0.2
+
+ dependencies:
+ '@types/react': 18.3.27
+ react: 19.2.4
+ tslib: 2.8.1
+
+ dependencies:
+ '@types/react': 18.3.27
+ detect-node-es: 1.1.0
+ react: 19.2.4
+ tslib: 2.8.1
+
+ dependencies:
+ '@types/unist': 3.0.3
+ unist-util-stringify-position: 4.0.0
+
dependencies:
- esbuild: 0.25.12
+ '@types/unist': 3.0.3
+ vfile-message: 4.0.3
+
+ dependencies:
+ '@types/node': 22.19.8
+ esbuild: 0.27.2
fdir: 6.5.0([email protected])
picomatch: 4.0.3
postcss: 8.5.6
- rollup: 4.53.3
+ rollup: 4.57.1
tinyglobby: 0.2.15
+ tsx: 4.21.0
optionalDependencies:
- '@types/node': 22.19.1
fsevents: 2.3.3
- jiti: 2.6.1
- tsx: 4.20.6
- yaml: 2.8.2
dependencies:
- '@vitest/expect': 4.0.14
- '@vitest/pretty-format': 4.0.14
- '@vitest/runner': 4.0.14
- '@vitest/snapshot': 4.0.14
- '@vitest/spy': 4.0.14
- '@vitest/utils': 4.0.14
+ '@types/node': 22.19.8
+ '@vitest/expect': 4.0.18
+ '@vitest/mocker': 4.0.18([email protected])
+ '@vitest/pretty-format': 4.0.18
+ '@vitest/runner': 4.0.18
+ '@vitest/snapshot': 4.0.18
+ '@vitest/spy': 4.0.18
+ '@vitest/utils': 4.0.18
es-module-lexer: 1.7.0
- expect-type: 1.2.2
+ expect-type: 1.3.0
+ happy-dom: 20.5.0
magic-string: 0.30.21
obug: 2.1.1
pathe: 2.0.3
picomatch: 4.0.3
std-env: 3.10.0
tinybench: 2.9.0
- tinyexec: 0.3.2
+ tinyexec: 1.0.2
tinyglobby: 0.2.15
tinyrainbow: 3.0.3
+ vite: 7.3.1(@types/[email protected])([email protected])
why-is-node-running: 2.3.0
- optionalDependencies:
- '@types/node': 22.19.1
- happy-dom: 20.0.11
transitivePeerDependencies:
- jiti
- less
@@ -2188,9 +4079,8 @@ snapshots:
siginfo: 2.0.0
stackback: 0.0.2
- optional: true
diff --git a/libs/typescript/pnpm-workspace.yaml b/libs/typescript/pnpm-workspace.yaml
index 4231ef3d6d..3d90fa6bec 100644
--- a/libs/typescript/pnpm-workspace.yaml
+++ b/libs/typescript/pnpm-workspace.yaml
@@ -2,5 +2,6 @@ packages:
- "computer"
- "core"
- "agent"
+ - "playground"
minimumReleaseAge: 46080