diff --git a/Dockerfile b/Dockerfile
index d40b565..fad58e8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,5 +9,6 @@ RUN chmod +x start.sh
ENV UIPATH_DEV_SERVER_PORT=80
ENV UIPATH_DEV_SERVER_HOST=0.0.0.0
+ENV UIPATH_AUTH_ENABLED=false
CMD ["/bin/sh", "/app/start.sh"]
diff --git a/pyproject.toml b/pyproject.toml
index 3ee1904..0948d99 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "uipath-dev"
-version = "0.0.56"
+version = "0.0.57"
description = "UiPath Developer Console"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
diff --git a/src/uipath/dev/server/app.py b/src/uipath/dev/server/app.py
index 542582c..7f5df68 100644
--- a/src/uipath/dev/server/app.py
+++ b/src/uipath/dev/server/app.py
@@ -3,6 +3,7 @@
from __future__ import annotations
import logging
+import os
from pathlib import Path
from fastapi import FastAPI
@@ -129,6 +130,17 @@ async def _favicon_svg_route():
# Store server reference on app state for route access
app.state.server = server
+ auth_enabled = os.environ.get("UIPATH_AUTH_ENABLED", "true").lower() not in (
+ "false",
+ "0",
+ "no",
+ )
+
+ # Config endpoint — tells the frontend which features are available
+ @app.get("/api/config", include_in_schema=False)
+ async def _config():
+ return {"auth_enabled": auth_enabled}
+
# Register routes
from uipath.dev.server.routes.entrypoints import router as entrypoints_router
from uipath.dev.server.routes.graph import router as graph_router
@@ -136,6 +148,13 @@ async def _favicon_svg_route():
from uipath.dev.server.routes.runs import router as runs_router
from uipath.dev.server.ws.handler import router as ws_router
+ if auth_enabled:
+ from uipath.dev.server.auth import restore_session
+ from uipath.dev.server.routes.auth import router as auth_router
+
+ app.include_router(auth_router, prefix="/api")
+ restore_session()
+
app.include_router(entrypoints_router, prefix="/api")
app.include_router(runs_router, prefix="/api")
app.include_router(graph_router, prefix="/api")
diff --git a/src/uipath/dev/server/auth.py b/src/uipath/dev/server/auth.py
new file mode 100644
index 0000000..c76dd54
--- /dev/null
+++ b/src/uipath/dev/server/auth.py
@@ -0,0 +1,1127 @@
+"""Interactive OAuth authentication service for the dev server.
+
+Implements the same PKCE-based authorization code flow as the Python SDK's
+``uipath auth`` CLI command. A temporary callback server is spun up on one of
+the registered redirect-URI ports (8104, 8055, 42042) to receive the token from
+the browser.
+"""
+
+from __future__ import annotations
+
+import asyncio
+import base64
+import hashlib
+import http.server
+import json
+import logging
+import os
+import socketserver
+import threading
+import time
+from dataclasses import dataclass, field
+from pathlib import Path
+from typing import Any
+from urllib.parse import urlencode
+
+import httpx
+
+logger = logging.getLogger(__name__)
+
+# ---------------------------------------------------------------------------
+# Constants
+# ---------------------------------------------------------------------------
+CLIENT_ID = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00"
+SCOPES = (
+ "offline_access ProcessMining OrchestratorApiUserAccess StudioWebBackend "
+ "IdentityServerApi ConnectionService DataService DocumentUnderstanding "
+ "Du.Digitization.Api Du.Classification.Api Du.Extraction.Api "
+ "Du.Validation.Api EnterpriseContextService Directory JamJamApi "
+ "LLMGateway LLMOps OMS RCS.FolderAuthorization TM.Projects "
+ "TM.TestCases TM.Requirements TM.TestSets AutomationSolutions"
+)
+CANDIDATE_PORTS = [8104, 8055, 42042]
+
+# ---------------------------------------------------------------------------
+# PKCE helpers
+# ---------------------------------------------------------------------------
+
+
+def _generate_pkce() -> tuple[str, str]:
+ """Return (code_verifier, code_challenge) for PKCE S256."""
+ verifier = base64.urlsafe_b64encode(os.urandom(32)).decode().rstrip("=")
+ challenge = (
+ base64.urlsafe_b64encode(hashlib.sha256(verifier.encode()).digest())
+ .decode()
+ .rstrip("=")
+ )
+ return verifier, challenge
+
+
+def _generate_state() -> str:
+ return base64.urlsafe_b64encode(os.urandom(32)).decode().rstrip("=")
+
+
+def _parse_jwt_payload(token: str) -> dict[str, Any]:
+ """Decode the payload section of a JWT (no signature verification)."""
+ parts = token.split(".")
+ if len(parts) < 2:
+ raise ValueError("Invalid JWT")
+ padded = parts[1] + "=" * (-len(parts[1]) % 4)
+ return json.loads(base64.urlsafe_b64decode(padded))
+
+
+# ---------------------------------------------------------------------------
+# Port finder
+# ---------------------------------------------------------------------------
+
+
+def _try_bind_server(
+ candidates: list[int], handler_class: type
+) -> socketserver.TCPServer | None:
+ """Try to bind a TCPServer on the first available candidate port."""
+ socketserver.TCPServer.allow_reuse_address = True
+ for port in candidates:
+ try:
+ httpd = socketserver.TCPServer(("127.0.0.1", port), handler_class)
+ return httpd
+ except OSError:
+ continue
+ return None
+
+
+# ---------------------------------------------------------------------------
+# Auth state
+# ---------------------------------------------------------------------------
+
+
+@dataclass
+class AuthState:
+ """Mutable state for the in-progress or completed OAuth flow."""
+
+ status: str = "unauthenticated" # unauthenticated | pending | needs_tenant | authenticated | expired
+ environment: str = "cloud"
+ token_data: dict[str, Any] = field(default_factory=dict)
+ tenants: list[dict[str, str]] = field(default_factory=list)
+ organization: dict[str, str] = field(default_factory=dict)
+ uipath_url: str | None = None
+ # Remembered from last session for seamless re-auth
+ _last_tenant: str | None = None
+ _last_org: dict[str, str] = field(default_factory=dict)
+ _last_environment: str | None = None
+ # internal
+ _code_verifier: str | None = None
+ _state: str | None = None
+ _port: int | None = None
+ _callback_server: _CallbackServer | None = None
+ _token_event: asyncio.Event | None = None
+ _loop: asyncio.AbstractEventLoop | None = None
+ _wait_task: asyncio.Task[None] | None = None
+
+
+_auth = AuthState()
+
+
+def get_auth_state() -> AuthState:
+ """Return the module-level auth state singleton."""
+ return _auth
+
+
+def reset_auth_state() -> None:
+ """Reset the auth state to its initial (unauthenticated) values."""
+ global _auth
+ _auth = AuthState()
+
+
+# ---------------------------------------------------------------------------
+# Callback HTML (adapted from SDK index.html)
+# ---------------------------------------------------------------------------
+
+_CALLBACK_HTML = """\
+
+
+
+
+
+
+ UiPath CLI Authentication
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Processing authentication request...
+
+
+
+
+ Authenticating...
+ Securely exchanging authorization code for access tokens.
+
+
+
+
+
+
+
+
+
+
+"""
+
+# ---------------------------------------------------------------------------
+# Callback HTTP server
+# ---------------------------------------------------------------------------
+
+
+def _make_handler(
+ html: str,
+ port: int,
+ csrf_state: str,
+ token_callback: Any,
+) -> type:
+ """Build the HTTP request handler class with closures over request params."""
+
+ class Handler(http.server.BaseHTTPRequestHandler):
+ def log_message(self, fmt: str, *args: Any) -> None:
+ pass
+
+ def do_GET(self) -> None:
+ content = html.encode()
+ self.send_response(200)
+ self.send_header("Content-Type", "text/html")
+ self.send_header("Content-Length", str(len(content)))
+ self._cors()
+ self.end_headers()
+ self.wfile.write(content)
+
+ def do_POST(self) -> None:
+ if self.path == f"/set_token/{csrf_state}":
+ length = int(self.headers.get("Content-Length", 0))
+ try:
+ body = json.loads(self.rfile.read(length))
+ except (json.JSONDecodeError, ValueError):
+ self.send_error(400, "Malformed JSON")
+ return
+ self.send_response(200)
+ self._cors()
+ self.end_headers()
+ self.wfile.write(b"OK")
+ # Small delay so the browser gets the response before we shut down
+ time.sleep(0.5)
+ token_callback(body)
+ else:
+ self.send_error(404)
+
+ def do_OPTIONS(self) -> None:
+ self.send_response(200)
+ self._cors()
+ self.end_headers()
+
+ def _cors(self) -> None:
+ origin = f"http://localhost:{port}"
+ self.send_header("Access-Control-Allow-Origin", origin)
+ self.send_header("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
+ self.send_header("Access-Control-Allow-Headers", "Content-Type")
+
+ return Handler
+
+
+class _CallbackServer:
+ """Temporary HTTP server that receives the OAuth token from the browser."""
+
+ def __init__(self, httpd: socketserver.TCPServer) -> None:
+ self.httpd: socketserver.TCPServer | None = httpd
+ self.port: int = httpd.server_address[1]
+ self._thread: threading.Thread | None = None
+ self._shutdown = False
+
+ def start(self) -> None:
+ self._shutdown = False
+ self._thread = threading.Thread(target=self._serve, daemon=True)
+ self._thread.start()
+
+ def _serve(self) -> None:
+ try:
+ while not self._shutdown and self.httpd:
+ self.httpd.handle_request()
+ except Exception:
+ pass
+
+ def stop(self) -> None:
+ self._shutdown = True
+ if self.httpd:
+ self.httpd.server_close()
+ self.httpd = None
+
+
+# ---------------------------------------------------------------------------
+# Public API
+# ---------------------------------------------------------------------------
+
+
+_VALID_ENVIRONMENTS = {"cloud", "staging", "alpha"}
+
+
+def build_auth_url(environment: str) -> dict[str, Any]:
+ """Start the OAuth flow: generate PKCE, spin up callback server, return auth URL."""
+ if environment not in _VALID_ENVIRONMENTS:
+ raise ValueError(
+ f"Invalid environment '{environment}'. Must be one of: {', '.join(sorted(_VALID_ENVIRONMENTS))}"
+ )
+
+ auth = get_auth_state()
+
+ # Stop any previous callback server and cancel any pending wait task
+ if auth._callback_server:
+ auth._callback_server.stop()
+ if auth._wait_task and not auth._wait_task.done():
+ auth._wait_task.cancel()
+
+ verifier, challenge = _generate_pkce()
+ state = _generate_state()
+ domain = f"https://{environment}.uipath.com"
+
+ # Build handler and bind server atomically (no TOCTOU race)
+ # We need the port first to construct the HTML, so we do a two-step:
+ # 1. Build a temporary handler, bind to get the port
+ # 2. Rebuild the handler with the correct HTML, then swap
+ def on_token(token_data: dict[str, Any]) -> None:
+ auth.token_data = token_data
+ if auth._loop and auth._token_event:
+ auth._loop.call_soon_threadsafe(auth._token_event.set)
+
+ # _make_handler needs the port for CORS, and the HTML needs the port for
+ # redirect_uri. We build a placeholder handler to bind, then rebuild.
+ placeholder = _make_handler("", 0, state, on_token)
+ httpd = _try_bind_server(CANDIDATE_PORTS, placeholder)
+ if httpd is None:
+ raise RuntimeError(
+ f"All callback ports ({', '.join(str(p) for p in CANDIDATE_PORTS)}) are in use"
+ )
+
+ port = httpd.server_address[1]
+ redirect_uri = f"http://localhost:{port}/oidc/login"
+
+ html = (
+ _CALLBACK_HTML.replace("__STATE__", state)
+ .replace("__CODE_VERIFIER__", verifier)
+ .replace("__REDIRECT_URI__", redirect_uri)
+ .replace("__CLIENT_ID__", CLIENT_ID)
+ .replace("__DOMAIN__", domain)
+ )
+
+ # Replace the handler with the real one containing the correct HTML/port
+ httpd.RequestHandlerClass = _make_handler(html, port, state, on_token)
+
+ query = urlencode(
+ {
+ "client_id": CLIENT_ID,
+ "redirect_uri": redirect_uri,
+ "response_type": "code",
+ "scope": SCOPES,
+ "state": state,
+ "code_challenge": challenge,
+ "code_challenge_method": "S256",
+ }
+ )
+ auth_url = f"{domain}/identity_/connect/authorize?{query}"
+
+ # Store state for later (preserve remembered tenant info for re-auth)
+ auth.status = "pending"
+ auth.environment = environment
+ auth._code_verifier = verifier
+ auth._state = state
+ auth._port = port
+
+ # Set up asyncio event for signalling
+ loop = asyncio.get_running_loop()
+ auth._token_event = asyncio.Event()
+ auth._loop = loop
+
+ server = _CallbackServer(httpd)
+ server.start()
+ auth._callback_server = server
+
+ auth._wait_task = asyncio.ensure_future(_wait_for_token(auth))
+
+ return {"auth_url": auth_url, "status": "pending"}
+
+
+async def _wait_for_token(auth: AuthState) -> None:
+ """Wait for the callback server to receive the token, then resolve tenants."""
+ try:
+ if auth._token_event:
+ await asyncio.wait_for(auth._token_event.wait(), timeout=300)
+ except asyncio.TimeoutError:
+ logger.warning("OAuth flow timed out after 5 minutes")
+ auth.status = "unauthenticated"
+ return
+ finally:
+ if auth._callback_server:
+ auth._callback_server.stop()
+ auth._callback_server = None
+
+ if not auth.token_data:
+ auth.status = "unauthenticated"
+ return
+
+ # Resolve tenants
+ try:
+ domain = f"https://{auth.environment}.uipath.com"
+ access_token = auth.token_data.get("access_token", "")
+ claims = _parse_jwt_payload(access_token)
+ prt_id = claims.get("prt_id", "")
+
+ url = f"{domain}/{prt_id}/portal_/api/filtering/leftnav/tenantsAndOrganizationInfo"
+ async with httpx.AsyncClient() as client:
+ resp = await client.get(
+ url, headers={"Authorization": f"Bearer {access_token}"}
+ )
+ resp.raise_for_status()
+ data = resp.json()
+
+ auth.tenants = data.get("tenants", [])
+ auth.organization = data.get("organization", {})
+
+ tenant_names = [t["name"] for t in auth.tenants]
+
+ if auth._last_tenant and auth._last_tenant in tenant_names:
+ # Re-auth: auto-select the previously used tenant
+ _finalize_tenant(auth, auth._last_tenant)
+ elif len(auth.tenants) == 1:
+ # Auto-select single tenant
+ _finalize_tenant(auth, auth.tenants[0]["name"])
+ else:
+ auth.status = "needs_tenant"
+ except Exception:
+ logger.exception("Failed to resolve tenants")
+ auth.status = "unauthenticated"
+
+
+def select_tenant(tenant_name: str) -> dict[str, Any]:
+ """Select a tenant and finalize authentication."""
+ auth = get_auth_state()
+ tenant = next((t for t in auth.tenants if t["name"] == tenant_name), None)
+ if not tenant:
+ raise ValueError(f"Tenant '{tenant_name}' not found")
+ _finalize_tenant(auth, tenant_name)
+ return {"status": "authenticated", "uipath_url": auth.uipath_url}
+
+
+def _finalize_tenant(auth: AuthState, tenant_name: str) -> None:
+ """Write .env and os.environ with the resolved credentials."""
+ org_name = auth.organization.get("name", "")
+ domain = f"https://{auth.environment}.uipath.com"
+ uipath_url = f"{domain}/{org_name}/{tenant_name}"
+ access_token = auth.token_data.get("access_token", "")
+
+ auth.uipath_url = uipath_url
+ auth.status = "authenticated"
+
+ # Remember for seamless re-auth after expiry
+ auth._last_tenant = tenant_name
+ auth._last_org = dict(auth.organization)
+ auth._last_environment = auth.environment
+
+ # Update os.environ
+ os.environ["UIPATH_ACCESS_TOKEN"] = access_token
+ os.environ["UIPATH_URL"] = uipath_url
+
+ # Write/update .env file (preserving comments, blank lines, and ordering)
+ env_path = Path.cwd() / ".env"
+ lines: list[str] = []
+ updated_keys: set[str] = set()
+ new_values = {"UIPATH_ACCESS_TOKEN": access_token, "UIPATH_URL": uipath_url}
+
+ if env_path.exists():
+ with open(env_path) as f:
+ for raw_line in f:
+ stripped = raw_line.strip()
+ if "=" in stripped and not stripped.startswith("#"):
+ key = stripped.split("=", 1)[0]
+ if key in new_values:
+ lines.append(f"{key}={new_values[key]}\n")
+ updated_keys.add(key)
+ continue
+ lines.append(raw_line)
+
+ # Append any keys that weren't already in the file
+ for key, value in new_values.items():
+ if key not in updated_keys:
+ lines.append(f"{key}={value}\n")
+
+ with open(env_path, "w") as f:
+ f.writelines(lines)
+
+
+def logout() -> None:
+ """Clear auth state and env vars."""
+ auth = get_auth_state()
+ if auth._callback_server:
+ auth._callback_server.stop()
+
+ os.environ.pop("UIPATH_ACCESS_TOKEN", None)
+ os.environ.pop("UIPATH_URL", None)
+
+ reset_auth_state()
+
+
+def _check_token_expiry(auth: AuthState) -> None:
+ """Flip status to 'expired' if the current token has expired."""
+ if auth.status != "authenticated":
+ return
+ access_token = auth.token_data.get("access_token", "")
+ if not access_token:
+ return
+ try:
+ claims = _parse_jwt_payload(access_token)
+ exp = claims.get("exp")
+ if exp is not None and float(exp) < time.time():
+ auth.status = "expired"
+ except Exception:
+ pass
+
+
+def get_status() -> dict[str, Any]:
+ """Return current auth status for the frontend."""
+ auth = get_auth_state()
+
+ _check_token_expiry(auth)
+
+ result: dict[str, Any] = {"status": auth.status}
+
+ if auth.status == "needs_tenant":
+ result["tenants"] = [t["name"] for t in auth.tenants]
+
+ if auth.status in ("authenticated", "expired"):
+ result["uipath_url"] = auth.uipath_url
+
+ return result
+
+
+def restore_session() -> None:
+ """Check env/.env for existing credentials and restore auth state if valid."""
+ auth = get_auth_state()
+ if auth.status != "unauthenticated":
+ return
+
+ # Try os.environ first, then .env file
+ access_token = os.environ.get("UIPATH_ACCESS_TOKEN", "")
+ uipath_url = os.environ.get("UIPATH_URL", "")
+
+ if not access_token or not uipath_url:
+ # Try reading from .env
+ env_path = Path.cwd() / ".env"
+ if env_path.exists():
+ env_vars: dict[str, str] = {}
+ with open(env_path) as f:
+ for line in f:
+ line = line.strip()
+ if "=" in line and not line.startswith("#"):
+ key, value = line.split("=", 1)
+ env_vars[key.strip()] = value.strip()
+ access_token = access_token or env_vars.get("UIPATH_ACCESS_TOKEN", "")
+ uipath_url = uipath_url or env_vars.get("UIPATH_URL", "")
+
+ if not access_token or not uipath_url:
+ return
+
+ # Check token expiry
+ try:
+ claims = _parse_jwt_payload(access_token)
+ exp = claims.get("exp")
+ if exp is not None and float(exp) < time.time():
+ logger.debug("Existing token is expired, skipping restore")
+ return
+ except Exception:
+ return
+
+ # Token is valid — restore state
+ auth.status = "authenticated"
+ auth.uipath_url = uipath_url
+ auth.token_data = {"access_token": access_token}
+
+ # Ensure os.environ is populated
+ os.environ["UIPATH_ACCESS_TOKEN"] = access_token
+ os.environ["UIPATH_URL"] = uipath_url
diff --git a/src/uipath/dev/server/frontend/src/App.tsx b/src/uipath/dev/server/frontend/src/App.tsx
index 183b76c..ef3d312 100644
--- a/src/uipath/dev/server/frontend/src/App.tsx
+++ b/src/uipath/dev/server/frontend/src/App.tsx
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { useRunStore } from "./store/useRunStore";
+import { useAuthStore } from "./store/useAuthStore";
import { useWebSocket } from "./store/useWebSocket";
import { listRuns, listEntrypoints, getRun } from "./api/client";
import type { RunDetail } from "./types/run";
@@ -39,13 +40,15 @@ export default function App() {
}
}, [view, routeRunId, selectedRunId, selectRun]);
- // Load existing runs and entrypoints on mount
+ // Load existing runs, entrypoints, and auth status on mount
+ const initAuth = useAuthStore((s) => s.init);
useEffect(() => {
listRuns().then(setRuns).catch(console.error);
listEntrypoints()
.then((eps) => setEntrypoints(eps.map((e) => e.name)))
.catch(console.error);
- }, [setRuns, setEntrypoints]);
+ initAuth();
+ }, [setRuns, setEntrypoints, initAuth]);
const selectedRun = selectedRunId ? runs[selectedRunId] : null;
diff --git a/src/uipath/dev/server/frontend/src/api/auth.ts b/src/uipath/dev/server/frontend/src/api/auth.ts
new file mode 100644
index 0000000..344c6a9
--- /dev/null
+++ b/src/uipath/dev/server/frontend/src/api/auth.ts
@@ -0,0 +1,35 @@
+const BASE = "/api";
+
+export async function startLogin(environment: string): Promise<{ auth_url: string; status: string }> {
+ const res = await fetch(`${BASE}/auth/login`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ environment }),
+ });
+ if (!res.ok) throw new Error(`Login failed: ${res.status}`);
+ return res.json();
+}
+
+export async function getAuthStatus(): Promise<{
+ status: "unauthenticated" | "pending" | "needs_tenant" | "authenticated" | "expired";
+ tenants?: string[];
+ uipath_url?: string;
+}> {
+ const res = await fetch(`${BASE}/auth/status`);
+ if (!res.ok) throw new Error(`Status check failed: ${res.status}`);
+ return res.json();
+}
+
+export async function selectTenant(tenantName: string): Promise<{ status: string; uipath_url: string }> {
+ const res = await fetch(`${BASE}/auth/select-tenant`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ tenant_name: tenantName }),
+ });
+ if (!res.ok) throw new Error(`Tenant selection failed: ${res.status}`);
+ return res.json();
+}
+
+export async function logout(): Promise {
+ await fetch(`${BASE}/auth/logout`, { method: "POST" });
+}
diff --git a/src/uipath/dev/server/frontend/src/components/layout/Sidebar.tsx b/src/uipath/dev/server/frontend/src/components/layout/Sidebar.tsx
index 1265289..ab5f4ef 100644
--- a/src/uipath/dev/server/frontend/src/components/layout/Sidebar.tsx
+++ b/src/uipath/dev/server/frontend/src/components/layout/Sidebar.tsx
@@ -1,5 +1,7 @@
+import { useState } from "react";
import type { RunSummary } from "../../types/run";
import { useTheme } from "../../store/useTheme";
+import { useAuthStore } from "../../store/useAuthStore";
import RunHistoryItem from "../runs/RunHistoryItem";
interface Props {
@@ -114,21 +116,8 @@ export default function Sidebar({ runs, selectedRunId, onSelectRun, onNewRun, is
)}
- {/* GitHub link */}
-
+ {/* Auth section */}
+
>
);
@@ -214,21 +203,160 @@ export default function Sidebar({ runs, selectedRunId, onSelectRun, onNewRun, is
)}
- {/* GitHub link */}
-
-
+
+ );
+}
+
+function AuthFooter() {
+ const { enabled, status, environment, tenants, uipathUrl, setEnvironment, startLogin, selectTenant, logout } = useAuthStore();
+ const [selectedTenant, setSelectedTenant] = useState("");
+
+ if (!enabled) return null;
+
+ if (status === "authenticated" || status === "expired") {
+ // Truncate URL for display: show org/tenant part only
+ const shortUrl = uipathUrl
+ ? uipathUrl.replace(/^https?:\/\/[^/]+\//, "")
+ : "";
+ const isExpired = status === "expired";
+ return (
+
+
+ {isExpired ? (
+
+ ) : (
+
+
+
+ {shortUrl}
+
+
+ )}
+
+
+
+ );
+ }
+
+ if (status === "pending") {
+ return (
+
+
+
+ Signing in…
+
+
+ );
+ }
+
+ if (status === "needs_tenant") {
+ return (
+
+
+
+
-
+ );
+ }
+
+ // Unauthenticated
+ return (
+
+
+
+
);
}
diff --git a/src/uipath/dev/server/frontend/src/components/runs/NewRunPanel.tsx b/src/uipath/dev/server/frontend/src/components/runs/NewRunPanel.tsx
index 00562a8..d5bba3b 100644
--- a/src/uipath/dev/server/frontend/src/components/runs/NewRunPanel.tsx
+++ b/src/uipath/dev/server/frontend/src/components/runs/NewRunPanel.tsx
@@ -72,6 +72,7 @@ export default function NewRunPanel() {
Entrypoint
)}
+
+ {/* GitHub link */}
+
);
diff --git a/src/uipath/dev/server/frontend/src/store/useAuthStore.ts b/src/uipath/dev/server/frontend/src/store/useAuthStore.ts
new file mode 100644
index 0000000..6ae80f3
--- /dev/null
+++ b/src/uipath/dev/server/frontend/src/store/useAuthStore.ts
@@ -0,0 +1,167 @@
+import { create } from "zustand";
+import * as authApi from "../api/auth";
+
+type AuthStatus = "unauthenticated" | "pending" | "needs_tenant" | "authenticated" | "expired";
+type Environment = "cloud" | "staging" | "alpha";
+
+const ENV_KEY = "uipath-env";
+const VALID_ENVS: Environment[] = ["cloud", "staging", "alpha"];
+
+function loadEnvironment(): Environment {
+ const stored = localStorage.getItem(ENV_KEY);
+ return VALID_ENVS.includes(stored as Environment) ? (stored as Environment) : "cloud";
+}
+
+interface AuthStore {
+ enabled: boolean;
+ status: AuthStatus;
+ environment: Environment;
+ tenants: string[];
+ uipathUrl: string | null;
+ pollTimer: ReturnType | null;
+ expiryTimer: ReturnType | null;
+
+ init: () => Promise;
+ setEnvironment: (env: Environment) => void;
+ startLogin: () => Promise;
+ pollStatus: () => void;
+ stopPolling: () => void;
+ startExpiryCheck: () => void;
+ stopExpiryCheck: () => void;
+ selectTenant: (name: string) => Promise;
+ logout: () => Promise;
+}
+
+export const useAuthStore = create((set, get) => ({
+ enabled: true,
+ status: "unauthenticated",
+ environment: loadEnvironment(),
+ tenants: [],
+ uipathUrl: null,
+ pollTimer: null,
+ expiryTimer: null,
+
+ init: async () => {
+ try {
+ // Check if auth is enabled via server config
+ const configRes = await fetch("/api/config");
+ if (configRes.ok) {
+ const config = await configRes.json();
+ if (!config.auth_enabled) {
+ set({ enabled: false });
+ return;
+ }
+ }
+
+ const data = await authApi.getAuthStatus();
+ set({
+ status: data.status,
+ tenants: data.tenants ?? [],
+ uipathUrl: data.uipath_url ?? null,
+ });
+
+ if (data.status === "authenticated") {
+ get().startExpiryCheck();
+ }
+ } catch (e) {
+ console.error("Auth init failed", e);
+ }
+ },
+
+ setEnvironment: (env) => {
+ localStorage.setItem(ENV_KEY, env);
+ set({ environment: env });
+ },
+
+ startLogin: async () => {
+ const { environment } = get();
+ try {
+ const data = await authApi.startLogin(environment);
+ set({ status: "pending" });
+ window.open(data.auth_url, "_blank");
+ get().pollStatus();
+ } catch (e) {
+ console.error("Login failed", e);
+ }
+ },
+
+ pollStatus: () => {
+ const { pollTimer } = get();
+ if (pollTimer) return; // already polling
+
+ const timer = setInterval(async () => {
+ try {
+ const data = await authApi.getAuthStatus();
+ if (data.status !== "pending") {
+ get().stopPolling();
+ set({
+ status: data.status,
+ tenants: data.tenants ?? [],
+ uipathUrl: data.uipath_url ?? null,
+ });
+ if (data.status === "authenticated") {
+ get().startExpiryCheck();
+ }
+ }
+ } catch {
+ // ignore transient errors
+ }
+ }, 2000);
+ set({ pollTimer: timer });
+ },
+
+ stopPolling: () => {
+ const { pollTimer } = get();
+ if (pollTimer) {
+ clearInterval(pollTimer);
+ set({ pollTimer: null });
+ }
+ },
+
+ startExpiryCheck: () => {
+ const { expiryTimer } = get();
+ if (expiryTimer) return;
+
+ const timer = setInterval(async () => {
+ try {
+ const data = await authApi.getAuthStatus();
+ if (data.status === "expired") {
+ get().stopExpiryCheck();
+ set({ status: "expired" });
+ }
+ } catch {
+ // ignore
+ }
+ }, 30_000);
+ set({ expiryTimer: timer });
+ },
+
+ stopExpiryCheck: () => {
+ const { expiryTimer } = get();
+ if (expiryTimer) {
+ clearInterval(expiryTimer);
+ set({ expiryTimer: null });
+ }
+ },
+
+ selectTenant: async (name) => {
+ try {
+ const data = await authApi.selectTenant(name);
+ set({ status: "authenticated", uipathUrl: data.uipath_url, tenants: [] });
+ get().startExpiryCheck();
+ } catch (e) {
+ console.error("Tenant selection failed", e);
+ }
+ },
+
+ logout: async () => {
+ get().stopPolling();
+ get().stopExpiryCheck();
+ try {
+ await authApi.logout();
+ } catch {
+ // ignore
+ }
+ set({ status: "unauthenticated", tenants: [], uipathUrl: null });
+ },
+}));
diff --git a/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo b/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo
index 69dc7a8..df275e8 100644
--- a/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo
+++ b/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo
@@ -1 +1 @@
-{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/client.ts","./src/api/websocket.ts","./src/components/chat/chatinput.tsx","./src/components/chat/chatinterrupt.tsx","./src/components/chat/chatmessage.tsx","./src/components/chat/chatpanel.tsx","./src/components/debug/debugcontrols.tsx","./src/components/graph/graphpanel.tsx","./src/components/graph/edges/elkedge.tsx","./src/components/graph/nodes/defaultnode.tsx","./src/components/graph/nodes/endnode.tsx","./src/components/graph/nodes/groupnode.tsx","./src/components/graph/nodes/modelnode.tsx","./src/components/graph/nodes/startnode.tsx","./src/components/graph/nodes/toolnode.tsx","./src/components/layout/sidebar.tsx","./src/components/logs/logpanel.tsx","./src/components/runs/newrunpanel.tsx","./src/components/runs/rundetailspanel.tsx","./src/components/runs/runeventspanel.tsx","./src/components/runs/runhistoryitem.tsx","./src/components/runs/setupview.tsx","./src/components/shared/jsonhighlight.tsx","./src/components/shared/reloadtoast.tsx","./src/components/traces/spandetails.tsx","./src/components/traces/tracetree.tsx","./src/hooks/usehashroute.ts","./src/hooks/useismobile.ts","./src/store/userunstore.ts","./src/store/usetheme.ts","./src/store/usewebsocket.ts","./src/types/graph.ts","./src/types/run.ts","./src/types/ws.ts"],"version":"5.7.3"}
\ No newline at end of file
+{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/api/websocket.ts","./src/components/chat/chatinput.tsx","./src/components/chat/chatinterrupt.tsx","./src/components/chat/chatmessage.tsx","./src/components/chat/chatpanel.tsx","./src/components/debug/debugcontrols.tsx","./src/components/graph/graphpanel.tsx","./src/components/graph/edges/elkedge.tsx","./src/components/graph/nodes/defaultnode.tsx","./src/components/graph/nodes/endnode.tsx","./src/components/graph/nodes/groupnode.tsx","./src/components/graph/nodes/modelnode.tsx","./src/components/graph/nodes/startnode.tsx","./src/components/graph/nodes/toolnode.tsx","./src/components/layout/sidebar.tsx","./src/components/logs/logpanel.tsx","./src/components/runs/newrunpanel.tsx","./src/components/runs/rundetailspanel.tsx","./src/components/runs/runeventspanel.tsx","./src/components/runs/runhistoryitem.tsx","./src/components/runs/setupview.tsx","./src/components/shared/jsonhighlight.tsx","./src/components/shared/reloadtoast.tsx","./src/components/traces/spandetails.tsx","./src/components/traces/tracetree.tsx","./src/hooks/usehashroute.ts","./src/hooks/useismobile.ts","./src/store/useauthstore.ts","./src/store/userunstore.ts","./src/store/usetheme.ts","./src/store/usewebsocket.ts","./src/types/graph.ts","./src/types/run.ts","./src/types/ws.ts"],"version":"5.7.3"}
\ No newline at end of file
diff --git a/src/uipath/dev/server/routes/auth.py b/src/uipath/dev/server/routes/auth.py
new file mode 100644
index 0000000..7838a07
--- /dev/null
+++ b/src/uipath/dev/server/routes/auth.py
@@ -0,0 +1,57 @@
+"""Authentication endpoints."""
+
+from __future__ import annotations
+
+from typing import Any, Literal
+
+from fastapi import APIRouter, HTTPException
+from pydantic import BaseModel
+
+from uipath.dev.server.auth import build_auth_url, get_status, logout, select_tenant
+
+router = APIRouter(tags=["auth"])
+
+
+class LoginRequest(BaseModel):
+ """Request body for starting the OAuth login flow."""
+
+ environment: Literal["cloud", "staging", "alpha"] = "cloud"
+
+
+class SelectTenantRequest(BaseModel):
+ """Request body for selecting a tenant."""
+
+ tenant_name: str
+
+
+@router.post("/auth/login")
+async def login(body: LoginRequest) -> dict[str, Any]:
+ """Start the interactive OAuth flow."""
+ try:
+ return build_auth_url(body.environment)
+ except ValueError as exc:
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
+ except RuntimeError as exc:
+ raise HTTPException(status_code=503, detail=str(exc)) from exc
+
+
+@router.get("/auth/status")
+async def auth_status() -> dict[str, Any]:
+ """Return current authentication status."""
+ return get_status()
+
+
+@router.post("/auth/select-tenant")
+async def auth_select_tenant(body: SelectTenantRequest) -> dict[str, Any]:
+ """Select a tenant after login."""
+ try:
+ return select_tenant(body.tenant_name)
+ except ValueError as exc:
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
+
+
+@router.post("/auth/logout")
+async def auth_logout() -> dict[str, str]:
+ """Clear authentication."""
+ logout()
+ return {"status": "unauthenticated"}
diff --git a/src/uipath/dev/server/static/assets/ChatPanel-DvMLkYmo.js b/src/uipath/dev/server/static/assets/ChatPanel-0HELh5u1.js
similarity index 99%
rename from src/uipath/dev/server/static/assets/ChatPanel-DvMLkYmo.js
rename to src/uipath/dev/server/static/assets/ChatPanel-0HELh5u1.js
index 11d0f40..6ac3f52 100644
--- a/src/uipath/dev/server/static/assets/ChatPanel-DvMLkYmo.js
+++ b/src/uipath/dev/server/static/assets/ChatPanel-0HELh5u1.js
@@ -1,4 +1,4 @@
-import{g as hr,j as P,a as $e}from"./vendor-react-BVoutfaX.js";import{u as sn}from"./index-AXT426N7.js";import"./vendor-reactflow-mU21rT8r.js";function zo(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Uo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$o=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ho={};function Vr(e,t){return(Ho.jsx?$o:Uo).test(e)}const Go=/[ \t\n\f\r]/g;function Ko(e){return typeof e=="object"?e.type==="text"?Yr(e.value):!1:Yr(e)}function Yr(e){return e.replace(Go,"")===""}class jt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}jt.prototype.normal={};jt.prototype.property={};jt.prototype.space=void 0;function Yi(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new jt(n,r,t)}function ir(e){return e.toLowerCase()}class De{constructor(t,n){this.attribute=n,this.property=t}}De.prototype.attribute="";De.prototype.booleanish=!1;De.prototype.boolean=!1;De.prototype.commaOrSpaceSeparated=!1;De.prototype.commaSeparated=!1;De.prototype.defined=!1;De.prototype.mustUseProperty=!1;De.prototype.number=!1;De.prototype.overloadedBoolean=!1;De.prototype.property="";De.prototype.spaceSeparated=!1;De.prototype.space=void 0;let qo=0;const ee=Et(),ke=Et(),ar=Et(),C=Et(),be=Et(),Ct=Et(),Ue=Et();function Et(){return 2**++qo}const or=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:ke,commaOrSpaceSeparated:Ue,commaSeparated:Ct,number:C,overloadedBoolean:ar,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),Fn=Object.keys(or);class br extends De{constructor(t,n,r,i){let o=-1;if(super(t,n),jr(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Zo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Zr,Jo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Zr.test(o)){let a=o.replace(jo,Qo);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=br}return new i(r,t)}function Qo(e){return"-"+e.toLowerCase()}function Jo(e){return e.charAt(1).toUpperCase()}const es=Yi([ji,Wo,Qi,Ji,ea],"html"),Er=Yi([ji,Vo,Qi,Ji,ea],"svg");function ts(e){return e.join(" ").trim()}var wt={},zn,Xr;function ns(){if(Xr)return zn;Xr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
+import{g as hr,j as P,a as $e}from"./vendor-react-BVoutfaX.js";import{u as sn}from"./index-BZ-OsryT.js";import"./vendor-reactflow-mU21rT8r.js";function zo(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Uo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$o=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ho={};function Vr(e,t){return(Ho.jsx?$o:Uo).test(e)}const Go=/[ \t\n\f\r]/g;function Ko(e){return typeof e=="object"?e.type==="text"?Yr(e.value):!1:Yr(e)}function Yr(e){return e.replace(Go,"")===""}class jt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}jt.prototype.normal={};jt.prototype.property={};jt.prototype.space=void 0;function Yi(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new jt(n,r,t)}function ir(e){return e.toLowerCase()}class De{constructor(t,n){this.attribute=n,this.property=t}}De.prototype.attribute="";De.prototype.booleanish=!1;De.prototype.boolean=!1;De.prototype.commaOrSpaceSeparated=!1;De.prototype.commaSeparated=!1;De.prototype.defined=!1;De.prototype.mustUseProperty=!1;De.prototype.number=!1;De.prototype.overloadedBoolean=!1;De.prototype.property="";De.prototype.spaceSeparated=!1;De.prototype.space=void 0;let qo=0;const ee=Et(),ke=Et(),ar=Et(),C=Et(),be=Et(),Ct=Et(),Ue=Et();function Et(){return 2**++qo}const or=Object.freeze(Object.defineProperty({__proto__:null,boolean:ee,booleanish:ke,commaOrSpaceSeparated:Ue,commaSeparated:Ct,number:C,overloadedBoolean:ar,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),Fn=Object.keys(or);class br extends De{constructor(t,n,r,i){let o=-1;if(super(t,n),jr(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Zo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Zr,Jo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Zr.test(o)){let a=o.replace(jo,Qo);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=br}return new i(r,t)}function Qo(e){return"-"+e.toLowerCase()}function Jo(e){return e.charAt(1).toUpperCase()}const es=Yi([ji,Wo,Qi,Ji,ea],"html"),Er=Yi([ji,Vo,Qi,Ji,ea],"svg");function ts(e){return e.join(" ").trim()}var wt={},zn,Xr;function ns(){if(Xr)return zn;Xr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
`,c="/",d="*",u="",f="comment",p="declaration";function g(x,m){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];m=m||{};var k=1,w=1;function T(D){var O=D.match(t);O&&(k+=O.length);var j=D.lastIndexOf(l);w=~j?D.length-j:w+D.length}function A(){var D={line:k,column:w};return function(O){return O.position=new _(D),G(),O}}function _(D){this.start=D,this.end={line:k,column:w},this.source=m.source}_.prototype.content=x;function $(D){var O=new Error(m.source+":"+k+":"+w+": "+D);if(O.reason=D,O.filename=m.source,O.line=k,O.column=w,O.source=x,!m.silent)throw O}function H(D){var O=D.exec(x);if(O){var j=O[0];return T(j),x=x.slice(j.length),O}}function G(){H(n)}function S(D){var O;for(D=D||[];O=B();)O!==!1&&D.push(O);return D}function B(){var D=A();if(!(c!=x.charAt(0)||d!=x.charAt(1))){for(var O=2;u!=x.charAt(O)&&(d!=x.charAt(O)||c!=x.charAt(O+1));)++O;if(O+=2,u===x.charAt(O-1))return $("End of comment missing");var j=x.slice(2,O-2);return w+=2,T(j),x=x.slice(O),w+=2,D({type:f,comment:j})}}function F(){var D=A(),O=H(r);if(O){if(B(),!H(i))return $("property missing ':'");var j=H(o),se=D({type:p,property:y(O[0].replace(e,u)),value:j?y(j[0].replace(e,u)):u});return H(a),se}}function J(){var D=[];S(D);for(var O;O=F();)O!==!1&&(D.push(O),S(D));return D}return G(),J()}function y(x){return x?x.replace(s,u):u}return zn=g,zn}var Qr;function rs(){if(Qr)return wt;Qr=1;var e=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.default=n;const t=e(ns());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),s=typeof i=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:d}=l;s?i(c,d,l):d&&(o=o||{},o[c]=d)}),o}return wt}var Ft={},Jr;function is(){if(Jr)return Ft;Jr=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(c){return!c||n.test(c)||e.test(c)},a=function(c,d){return d.toUpperCase()},s=function(c,d){return"".concat(d,"-")},l=function(c,d){return d===void 0&&(d={}),o(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,s):c=c.replace(r,s),c.replace(t,a))};return Ft.camelCase=l,Ft}var zt,ei;function as(){if(ei)return zt;ei=1;var e=zt&&zt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(rs()),n=is();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(s,l){s&&l&&(a[(0,n.camelCase)(s,o)]=l)}),a}return r.default=r,zt=r,zt}var os=as();const ss=hr(os),ta=na("end"),yr=na("start");function na(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ls(e){const t=yr(e),n=ta(e);if(t&&n)return{start:t,end:n}}function Kt(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ti(e.position):"start"in e||"end"in e?ti(e):"line"in e||"column"in e?sr(e):""}function sr(e){return ni(e&&e.line)+":"+ni(e&&e.column)}function ti(e){return sr(e&&e.start)+"-"+sr(e&&e.end)}function ni(e){return e&&typeof e=="number"?e:1}class Ae extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Kt(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ae.prototype.file="";Ae.prototype.name="";Ae.prototype.reason="";Ae.prototype.message="";Ae.prototype.stack="";Ae.prototype.column=void 0;Ae.prototype.line=void 0;Ae.prototype.ancestors=void 0;Ae.prototype.cause=void 0;Ae.prototype.fatal=void 0;Ae.prototype.place=void 0;Ae.prototype.ruleId=void 0;Ae.prototype.source=void 0;const _r={}.hasOwnProperty,cs=new Map,us=/[A-Z]/g,ds=new Set(["table","tbody","thead","tfoot","tr"]),ps=new Set(["td","th"]),ra="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fs(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=xs(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_s(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Er:es,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ia(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function ia(e,t,n){if(t.type==="element")return gs(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ms(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return bs(e,t,n);if(t.type==="mdxjsEsm")return hs(e,t);if(t.type==="root")return Es(e,t,n);if(t.type==="text")return ys(e,t)}function gs(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Er,e.schema=i),e.ancestors.push(t);const o=oa(e,t.tagName,!1),a=ks(e,t);let s=kr(e,t);return ds.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Ko(l):!0})),aa(e,a,o,t),xr(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function ms(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vt(e,t.position)}function hs(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vt(e,t.position)}function bs(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Er,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:oa(e,t.name,!0),a=ws(e,t),s=kr(e,t);return aa(e,a,o,t),xr(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Es(e,t,n){const r={};return xr(r,kr(e,t)),e.create(t,e.Fragment,r,n)}function ys(e,t){return t.value}function aa(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _s(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function xs(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=yr(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function ks(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&_r.call(t.properties,i)){const o=Ss(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&ps.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ws(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Vt(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Vt(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function kr(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:cs;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(He(e,e.length,0,t),e):t}const ai={}.hasOwnProperty;function la(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ve(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Re=ft(/[A-Za-z]/),Te=ft(/[\dA-Za-z]/),Ms=ft(/[#-'*+\--9=?A-Z^-~]/);function yn(e){return e!==null&&(e<32||e===127)}const lr=ft(/\d/),Ds=ft(/[\dA-Fa-f]/),Ls=ft(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function ge(e){return e!==null&&(e<0||e===32)}function re(e){return e===-2||e===-1||e===32}const Nn=ft(new RegExp("\\p{P}|\\p{S}","u")),bt=ft(/\s/);function ft(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Rt(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ae(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return re(l)?(e.enter(n),s(l)):t(l)}function s(l){return re(l)&&o++a))return;const $=t.events.length;let H=$,G,S;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(G){S=t.events[H][1].end;break}G=!0}for(m(r),_=$;_w;){const A=n[T];t.containerState=A[1],A[0].exit.call(t,e)}n.length=w}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Us(e,t,n){return ae(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ot(e){if(e===null||ge(e)||bt(e))return 1;if(Nn(e))return 2}function vn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[r][1].end},f={...e[n][1].start};si(u,-l),si(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ke(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ke(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Ke(c,vn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ke(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Ke(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,He(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&re(_)?ae(e,k,"linePrefix",o+1)(_):k(_)}function k(_){return _===null||W(_)?e.check(li,y,T)(_):(e.enter("codeFlowValue"),w(_))}function w(_){return _===null||W(_)?(e.exit("codeFlowValue"),k(_)):(e.consume(_),w)}function T(_){return e.exit("codeFenced"),t(_)}function A(_,$,H){let G=0;return S;function S(O){return _.enter("lineEnding"),_.consume(O),_.exit("lineEnding"),B}function B(O){return _.enter("codeFencedFence"),re(O)?ae(_,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):F(O)}function F(O){return O===s?(_.enter("codeFencedFenceSequence"),J(O)):H(O)}function J(O){return O===s?(G++,_.consume(O),J):G>=a?(_.exit("codeFencedFenceSequence"),re(O)?ae(_,D,"whitespace")(O):D(O)):H(O)}function D(O){return O===null||W(O)?(_.exit("codeFencedFence"),$(O)):H(O)}}}function Qs(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const $n={name:"codeIndented",tokenize:el},Js={partial:!0,tokenize:tl};function el(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ae(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):W(c)?e.attempt(Js,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||W(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function tl(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ae(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):W(a)?i(a):n(a)}}const nl={name:"codeText",previous:il,resolve:rl,tokenize:al};function rl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ut(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ut(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ut(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function ga(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(m){return m===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(m),e.exit(o),f):m===null||m===32||m===41||yn(m)?n(m):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(m))}function f(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(s),f(m)):m===null||m===60||W(m)?n(m):(e.consume(m),m===92?g:p)}function g(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function y(m){return!d&&(m===null||m===41||ge(m))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(m)):d999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):W(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===null||p===91||p===93||W(p)||s++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!re(p)),p===92?f:u)}function f(p){return p===91||p===92||p===93?(e.consume(p),s++,u):u(p)}}function ha(e,t,n,r,i,o){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(o),c(f))}function c(f){return f===a?(e.exit(o),l(a)):f===null?n(f):W(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ae(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===a||f===null||W(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?u:d)}function u(f){return f===a||f===92?(e.consume(f),d):d(f)}}function qt(e,t){let n;return r;function r(i){return W(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):re(i)?ae(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const fl={name:"definition",tokenize:ml},gl={partial:!0,tokenize:hl};function ml(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),a(p)}function a(p){return ma.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=Ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return ge(p)?qt(e,c)(p):c(p)}function c(p){return ga(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(gl,u,u)(p)}function u(p){return re(p)?ae(e,f,"whitespace")(p):f(p)}function f(p){return p===null||W(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function hl(e,t,n){return r;function r(s){return ge(s)?qt(e,i)(s):n(s)}function i(s){return ha(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return re(s)?ae(e,a,"whitespace")(s):a(s)}function a(s){return s===null||W(s)?t(s):n(s)}}const bl={name:"hardBreakEscape",tokenize:El};function El(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return W(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const yl={name:"headingAtx",resolve:_l,tokenize:xl};function _l(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},He(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function xl(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||ge(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||W(d)?(e.exit("atxHeading"),t(d)):re(d)?ae(e,s,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),s(d))}function c(d){return d===null||d===35||ge(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),c)}}const kl=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ui=["pre","script","style","textarea"],wl={concrete:!0,name:"htmlFlow",resolveTo:vl,tokenize:Tl},Sl={partial:!0,tokenize:Cl},Nl={partial:!0,tokenize:Al};function vl(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Tl(e,t,n){const r=this;let i,o,a,s,l;return c;function c(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),u}function u(E){return E===33?(e.consume(E),f):E===47?(e.consume(E),o=!0,y):E===63?(e.consume(E),i=3,r.interrupt?t:h):Re(E)?(e.consume(E),a=String.fromCharCode(E),x):n(E)}function f(E){return E===45?(e.consume(E),i=2,p):E===91?(e.consume(E),i=5,s=0,g):Re(E)?(e.consume(E),i=4,r.interrupt?t:h):n(E)}function p(E){return E===45?(e.consume(E),r.interrupt?t:h):n(E)}function g(E){const Ce="CDATA[";return E===Ce.charCodeAt(s++)?(e.consume(E),s===Ce.length?r.interrupt?t:F:g):n(E)}function y(E){return Re(E)?(e.consume(E),a=String.fromCharCode(E),x):n(E)}function x(E){if(E===null||E===47||E===62||ge(E)){const Ce=E===47,Ge=a.toLowerCase();return!Ce&&!o&&ui.includes(Ge)?(i=1,r.interrupt?t(E):F(E)):kl.includes(a.toLowerCase())?(i=6,Ce?(e.consume(E),m):r.interrupt?t(E):F(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?k(E):w(E))}return E===45||Te(E)?(e.consume(E),a+=String.fromCharCode(E),x):n(E)}function m(E){return E===62?(e.consume(E),r.interrupt?t:F):n(E)}function k(E){return re(E)?(e.consume(E),k):S(E)}function w(E){return E===47?(e.consume(E),S):E===58||E===95||Re(E)?(e.consume(E),T):re(E)?(e.consume(E),w):S(E)}function T(E){return E===45||E===46||E===58||E===95||Te(E)?(e.consume(E),T):A(E)}function A(E){return E===61?(e.consume(E),_):re(E)?(e.consume(E),A):w(E)}function _(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,$):re(E)?(e.consume(E),_):H(E)}function $(E){return E===l?(e.consume(E),l=null,G):E===null||W(E)?n(E):(e.consume(E),$)}function H(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ge(E)?A(E):(e.consume(E),H)}function G(E){return E===47||E===62||re(E)?w(E):n(E)}function S(E){return E===62?(e.consume(E),B):n(E)}function B(E){return E===null||W(E)?F(E):re(E)?(e.consume(E),B):n(E)}function F(E){return E===45&&i===2?(e.consume(E),j):E===60&&i===1?(e.consume(E),se):E===62&&i===4?(e.consume(E),ue):E===63&&i===3?(e.consume(E),h):E===93&&i===5?(e.consume(E),pe):W(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Sl,fe,J)(E)):E===null||W(E)?(e.exit("htmlFlowData"),J(E)):(e.consume(E),F)}function J(E){return e.check(Nl,D,fe)(E)}function D(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),O}function O(E){return E===null||W(E)?J(E):(e.enter("htmlFlowData"),F(E))}function j(E){return E===45?(e.consume(E),h):F(E)}function se(E){return E===47?(e.consume(E),a="",Z):F(E)}function Z(E){if(E===62){const Ce=a.toLowerCase();return ui.includes(Ce)?(e.consume(E),ue):F(E)}return Re(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),Z):F(E)}function pe(E){return E===93?(e.consume(E),h):F(E)}function h(E){return E===62?(e.consume(E),ue):E===45&&i===2?(e.consume(E),h):F(E)}function ue(E){return E===null||W(E)?(e.exit("htmlFlowData"),fe(E)):(e.consume(E),ue)}function fe(E){return e.exit("htmlFlow"),t(E)}}function Al(e,t,n){const r=this;return i;function i(a){return W(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Cl(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Zt,t,n)}}const Ol={name:"htmlText",tokenize:Il};function Il(e,t,n){const r=this;let i,o,a;return s;function s(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),l}function l(h){return h===33?(e.consume(h),c):h===47?(e.consume(h),A):h===63?(e.consume(h),w):Re(h)?(e.consume(h),H):n(h)}function c(h){return h===45?(e.consume(h),d):h===91?(e.consume(h),o=0,g):Re(h)?(e.consume(h),k):n(h)}function d(h){return h===45?(e.consume(h),p):n(h)}function u(h){return h===null?n(h):h===45?(e.consume(h),f):W(h)?(a=u,se(h)):(e.consume(h),u)}function f(h){return h===45?(e.consume(h),p):u(h)}function p(h){return h===62?j(h):h===45?f(h):u(h)}function g(h){const ue="CDATA[";return h===ue.charCodeAt(o++)?(e.consume(h),o===ue.length?y:g):n(h)}function y(h){return h===null?n(h):h===93?(e.consume(h),x):W(h)?(a=y,se(h)):(e.consume(h),y)}function x(h){return h===93?(e.consume(h),m):y(h)}function m(h){return h===62?j(h):h===93?(e.consume(h),m):y(h)}function k(h){return h===null||h===62?j(h):W(h)?(a=k,se(h)):(e.consume(h),k)}function w(h){return h===null?n(h):h===63?(e.consume(h),T):W(h)?(a=w,se(h)):(e.consume(h),w)}function T(h){return h===62?j(h):w(h)}function A(h){return Re(h)?(e.consume(h),_):n(h)}function _(h){return h===45||Te(h)?(e.consume(h),_):$(h)}function $(h){return W(h)?(a=$,se(h)):re(h)?(e.consume(h),$):j(h)}function H(h){return h===45||Te(h)?(e.consume(h),H):h===47||h===62||ge(h)?G(h):n(h)}function G(h){return h===47?(e.consume(h),j):h===58||h===95||Re(h)?(e.consume(h),S):W(h)?(a=G,se(h)):re(h)?(e.consume(h),G):j(h)}function S(h){return h===45||h===46||h===58||h===95||Te(h)?(e.consume(h),S):B(h)}function B(h){return h===61?(e.consume(h),F):W(h)?(a=B,se(h)):re(h)?(e.consume(h),B):G(h)}function F(h){return h===null||h===60||h===61||h===62||h===96?n(h):h===34||h===39?(e.consume(h),i=h,J):W(h)?(a=F,se(h)):re(h)?(e.consume(h),F):(e.consume(h),D)}function J(h){return h===i?(e.consume(h),i=void 0,O):h===null?n(h):W(h)?(a=J,se(h)):(e.consume(h),J)}function D(h){return h===null||h===34||h===39||h===60||h===61||h===96?n(h):h===47||h===62||ge(h)?G(h):(e.consume(h),D)}function O(h){return h===47||h===62||ge(h)?G(h):n(h)}function j(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),t):n(h)}function se(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Z}function Z(h){return re(h)?ae(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):pe(h)}function pe(h){return e.enter("htmlTextData"),a(h)}}const Nr={name:"labelEnd",resolveAll:Ll,resolveTo:Pl,tokenize:Bl},Rl={tokenize:Fl},Ml={tokenize:zl},Dl={tokenize:Ul};function Ll(e){let t=-1;const n=[];for(;++t=3&&(c===null||W(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),re(c)?ae(e,s,"whitespace")(c):s(c))}}const Me={continuation:{tokenize:Zl},exit:Ql,name:"list",tokenize:jl},Vl={partial:!0,tokenize:Jl},Yl={partial:!0,tokenize:Xl};function jl(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:lr(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(En,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return lr(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Zt,r.interrupt?n:d,e.attempt(Vl,f,u))}function d(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function u(p){return re(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Zl(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Zt,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ae(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!re(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Yl,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ae(e,e.attempt(Me,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Xl(e,t,n){const r=this;return ae(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Ql(e){e.exit(this.containerState.type)}function Jl(e,t,n){const r=this;return ae(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const di={name:"setextUnderline",resolveTo:ec,tokenize:tc};function ec(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function tc(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,u;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){u=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),re(c)?ae(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||W(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const nc={tokenize:rc};function rc(e){const t=this,n=e.attempt(Zt,r,e.attempt(this.parser.constructs.flowInitial,i,ae(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ll,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ic={resolveAll:Ea()},ac=ba("string"),oc=ba("text");function ba(e){return{resolveAll:Ea(e==="text"?sc:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(d){return c(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=i[d];let f=-1;if(u)for(;++f-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function _c(e,t){let n=-1;const r=[];let i;for(;++n0){const Be=V.tokenStack[V.tokenStack.length-1];(Be[1]||fi).call(V,void 0,Be[0])}for(R.position={start:pt(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:pt(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},le=-1;++lei.map(i=>d[i]);
-var ze=Object.defineProperty;var Ve=(t,s,r)=>s in t?ze(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;var K=(t,s,r)=>Ve(t,typeof s!="symbol"?s+"":s,r);import{R as re,a as p,j as e,b as Fe}from"./vendor-react-BVoutfaX.js";import{H as Y,P as X,B as Ue,M as Je,u as Ge,a as qe,R as Ye,b as Xe,C as Ke,c as Ze,d as Qe}from"./vendor-reactflow-mU21rT8r.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(n){if(n.ep)return;n.ep=!0;const i=r(n);fetch(n.href,i)}})();const ue=t=>{let s;const r=new Set,o=(u,l)=>{const h=typeof u=="function"?u(s):u;if(!Object.is(h,s)){const j=s;s=l??(typeof h!="object"||h===null)?h:Object.assign({},s,h),r.forEach(b=>b(s,j))}},n=()=>s,c={setState:o,getState:n,getInitialState:()=>x,subscribe:u=>(r.add(u),()=>r.delete(u))},x=s=t(o,n,c);return c},et=(t=>t?ue(t):ue),tt=t=>t;function st(t,s=tt){const r=re.useSyncExternalStore(t.subscribe,re.useCallback(()=>s(t.getState()),[t,s]),re.useCallback(()=>s(t.getInitialState()),[t,s]));return re.useDebugValue(r),r}const pe=t=>{const s=et(t),r=o=>st(s,o);return Object.assign(r,s),r},$e=(t=>t?pe(t):pe),H=$e(t=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:s=>t(r=>{var i;let o=r.breakpoints;for(const a of s)(i=a.breakpoints)!=null&&i.length&&!o[a.id]&&(o={...o,[a.id]:Object.fromEntries(a.breakpoints.map(c=>[c,!0]))});const n={runs:Object.fromEntries(s.map(a=>[a.id,a]))};return o!==r.breakpoints&&(n.breakpoints=o),n}),upsertRun:s=>t(r=>{var n;const o={runs:{...r.runs,[s.id]:s}};if((n=s.breakpoints)!=null&&n.length&&!r.breakpoints[s.id]&&(o.breakpoints={...r.breakpoints,[s.id]:Object.fromEntries(s.breakpoints.map(i=>[i,!0]))}),(s.status==="completed"||s.status==="failed")&&r.activeNodes[s.id]){const{[s.id]:i,...a}=r.activeNodes;o.activeNodes=a}if(s.status!=="suspended"&&r.activeInterrupt[s.id]){const{[s.id]:i,...a}=r.activeInterrupt;o.activeInterrupt=a}return o}),selectRun:s=>t({selectedRunId:s}),addTrace:s=>t(r=>{const o=r.traces[s.run_id]??[],n=o.findIndex(a=>a.span_id===s.span_id),i=n>=0?o.map((a,c)=>c===n?s:a):[...o,s];return{traces:{...r.traces,[s.run_id]:i}}}),setTraces:(s,r)=>t(o=>({traces:{...o.traces,[s]:r}})),addLog:s=>t(r=>{const o=r.logs[s.run_id]??[];return{logs:{...r.logs,[s.run_id]:[...o,s]}}}),setLogs:(s,r)=>t(o=>({logs:{...o.logs,[s]:r}})),addChatEvent:(s,r)=>t(o=>{const n=o.chatMessages[s]??[],i=r.message;if(!i)return o;const a=i.messageId??i.message_id,c=i.role??"assistant",l=(i.contentParts??i.content_parts??[]).filter(k=>{const w=k.mimeType??k.mime_type??"";return w.startsWith("text/")||w==="application/json"}).map(k=>{const w=k.data;return(w==null?void 0:w.inline)??""}).join(`
-`).trim(),h=(i.toolCalls??i.tool_calls??[]).map(k=>({name:k.name??"",has_result:!!k.result})),j={message_id:a,role:c,content:l,tool_calls:h.length>0?h:void 0},b=n.findIndex(k=>k.message_id===a);if(b>=0)return{chatMessages:{...o.chatMessages,[s]:n.map((k,w)=>w===b?j:k)}};if(c==="user"){const k=n.findIndex(w=>w.message_id.startsWith("local-")&&w.role==="user"&&w.content===l);if(k>=0)return{chatMessages:{...o.chatMessages,[s]:n.map((w,R)=>R===k?j:w)}}}const E=[...n,j];return{chatMessages:{...o.chatMessages,[s]:E}}}),addLocalChatMessage:(s,r)=>t(o=>{const n=o.chatMessages[s]??[];return{chatMessages:{...o.chatMessages,[s]:[...n,r]}}}),setChatMessages:(s,r)=>t(o=>({chatMessages:{...o.chatMessages,[s]:r}})),setEntrypoints:s=>t({entrypoints:s}),breakpoints:{},toggleBreakpoint:(s,r)=>t(o=>{const n={...o.breakpoints[s]??{}};return n[r]?delete n[r]:n[r]=!0,{breakpoints:{...o.breakpoints,[s]:n}}}),clearBreakpoints:s=>t(r=>{const{[s]:o,...n}=r.breakpoints;return{breakpoints:n}}),activeNodes:{},setActiveNode:(s,r,o)=>t(n=>{const i=n.activeNodes[s]??{executing:{},prev:null};return{activeNodes:{...n.activeNodes,[s]:{executing:{...i.executing,[r]:o??null},prev:i.prev}}}}),removeActiveNode:(s,r)=>t(o=>{const n=o.activeNodes[s];if(!n)return o;const{[r]:i,...a}=n.executing;return{activeNodes:{...o.activeNodes,[s]:{executing:a,prev:r}}}}),resetRunGraphState:s=>t(r=>({stateEvents:{...r.stateEvents,[s]:[]},activeNodes:{...r.activeNodes,[s]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(s,r,o,n,i)=>t(a=>{const c=a.stateEvents[s]??[];return{stateEvents:{...a.stateEvents,[s]:[...c,{node_name:r,qualified_node_name:n,phase:i,timestamp:Date.now(),payload:o}]}}}),setStateEvents:(s,r)=>t(o=>({stateEvents:{...o.stateEvents,[s]:r}})),focusedSpan:null,setFocusedSpan:s=>t({focusedSpan:s}),activeInterrupt:{},setActiveInterrupt:(s,r)=>t(o=>({activeInterrupt:{...o.activeInterrupt,[s]:r}})),reloadPending:!1,setReloadPending:s=>t({reloadPending:s}),graphCache:{},setGraphCache:(s,r)=>t(o=>({graphCache:{...o.graphCache,[s]:r}}))}));class rt{constructor(s){K(this,"ws",null);K(this,"url");K(this,"handlers",new Set);K(this,"reconnectTimer",null);K(this,"shouldReconnect",!0);K(this,"pendingMessages",[]);K(this,"activeSubscriptions",new Set);const r=window.location.protocol==="https:"?"wss:":"ws:";this.url=s??`${r}//${window.location.host}/ws`}connect(){var s;((s=this.ws)==null?void 0:s.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const r of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:r}}));for(const r of this.pendingMessages)this.sendRaw(r);this.pendingMessages=[]},this.ws.onmessage=r=>{let o;try{o=JSON.parse(r.data)}catch{console.warn("[ws] failed to parse message",r.data);return}this.handlers.forEach(n=>{try{n(o)}catch(i){console.error("[ws] handler error",i)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var r;(r=this.ws)==null||r.close()})}disconnect(){var s;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(s=this.ws)==null||s.close(),this.ws=null}onMessage(s){return this.handlers.add(s),()=>this.handlers.delete(s)}sendRaw(s){var r;((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(s)}send(s,r){var n;const o=JSON.stringify({type:s,payload:r});((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?this.ws.send(o):this.pendingMessages.push(o)}subscribe(s){this.activeSubscriptions.add(s),this.send("subscribe",{run_id:s})}unsubscribe(s){this.activeSubscriptions.delete(s),this.send("unsubscribe",{run_id:s})}sendChatMessage(s,r){this.send("chat.message",{run_id:s,text:r})}sendInterruptResponse(s,r){this.send("chat.interrupt_response",{run_id:s,data:r})}debugStep(s){this.send("debug.step",{run_id:s})}debugContinue(s){this.send("debug.continue",{run_id:s})}debugStop(s){this.send("debug.stop",{run_id:s})}setBreakpoints(s,r){this.send("debug.set_breakpoints",{run_id:s,breakpoints:r})}}let oe=null;function ot(){return oe||(oe=new rt,oe.connect()),oe}function nt(){const t=p.useRef(ot()),{upsertRun:s,addTrace:r,addLog:o,addChatEvent:n,setActiveInterrupt:i,setActiveNode:a,removeActiveNode:c,resetRunGraphState:x,addStateEvent:u,setReloadPending:l}=H();return p.useEffect(()=>t.current.onMessage(b=>{switch(b.type){case"run.updated":s(b.payload);break;case"trace":r(b.payload);break;case"log":o(b.payload);break;case"chat":{const E=b.payload.run_id;n(E,b.payload);break}case"chat.interrupt":{const E=b.payload.run_id;i(E,b.payload);break}case"state":{const E=b.payload.run_id,k=b.payload.node_name,w=b.payload.qualified_node_name??null,R=b.payload.phase??null,B=b.payload.payload;k==="__start__"&&R==="started"&&x(E),R==="started"?a(E,k,w):R==="completed"&&c(E,k),u(E,k,B,w,R);break}case"reload":l(!0);break}}),[s,r,o,n,i,a,c,x,u,l]),t.current}const Z="/api";async function Q(t,s){const r=await fetch(t,s);if(!r.ok){let o;try{o=(await r.json()).detail||r.statusText}catch{o=r.statusText}const n=new Error(`HTTP ${r.status}`);throw n.detail=o,n.status=r.status,n}return r.json()}async function Ie(){return Q(`${Z}/entrypoints`)}async function at(t){return Q(`${Z}/entrypoints/${encodeURIComponent(t)}/schema`)}async function it(t){return Q(`${Z}/entrypoints/${encodeURIComponent(t)}/mock-input`)}async function ct(t){return Q(`${Z}/entrypoints/${encodeURIComponent(t)}/graph`)}async function he(t,s,r="run",o=[]){return Q(`${Z}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:t,input_data:s,mode:r,breakpoints:o})})}async function lt(){return Q(`${Z}/runs`)}async function ie(t){return Q(`${Z}/runs/${t}`)}async function dt(){return Q(`${Z}/reload`,{method:"POST"})}function ut(t){const s=t.replace(/^#\/?/,"");if(!s||s==="new")return{view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null};const r=s.match(/^setup\/([^/]+)\/(run|chat)$/);if(r)return{view:"setup",runId:null,tab:"traces",setupEntrypoint:decodeURIComponent(r[1]),setupMode:r[2]};const o=s.match(/^runs\/([^/]+)(?:\/(traces|output))?$/);return o?{view:"details",runId:o[1],tab:o[2]??"traces",setupEntrypoint:null,setupMode:null}:{view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null}}function pt(){return window.location.hash}function ht(t){return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)}function Pe(){const t=p.useSyncExternalStore(ht,pt),s=ut(t),r=p.useCallback(o=>{window.location.hash=o},[]);return{...s,navigate:r}}const xe="(max-width: 767px)";function xt(){const[t,s]=p.useState(()=>window.matchMedia(xe).matches);return p.useEffect(()=>{const r=window.matchMedia(xe),o=n=>s(n.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),t}function We(){const t=localStorage.getItem("uipath-dev-theme");return t==="light"||t==="dark"?t:"dark"}function Oe(t){document.documentElement.setAttribute("data-theme",t),localStorage.setItem("uipath-dev-theme",t)}Oe(We());const mt=$e(t=>({theme:We(),toggleTheme:()=>t(s=>{const r=s.theme==="dark"?"light":"dark";return Oe(r),{theme:r}})})),gt={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function me({run:t,isSelected:s,onClick:r}){var a;const o=gt[t.status]??"var(--text-muted)",n=((a=t.entrypoint.split("/").pop())==null?void 0:a.slice(0,16))??t.entrypoint,i=t.start_time?new Date(t.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"";return e.jsxs("button",{onClick:r,className:"w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:s?"color-mix(in srgb, var(--accent) 8%, var(--bg-primary))":void 0,borderLeft:s?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:c=>{s||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{s||(c.currentTarget.style.background="")},children:[e.jsx("span",{className:"shrink-0 w-1.5 h-1.5 rounded-full",style:{background:o}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs truncate",style:{color:s?"var(--text-primary)":"var(--text-secondary)"},children:n}),e.jsxs("div",{className:"text-[10px] tabular-nums",style:{color:"var(--text-muted)"},children:[i,t.duration?` · ${t.duration}`:""]})]})]})}function ft({runs:t,selectedRunId:s,onSelectRun:r,onNewRun:o,isMobile:n,isOpen:i,onClose:a}){const{theme:c,toggleTheme:x}=mt(),u=[...t].sort((l,h)=>new Date(h.start_time??0).getTime()-new Date(l.start_time??0).getTime());return n?i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:a}),e.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[e.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[e.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 cursor-pointer transition-opacity hover:opacity-80",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("rect",{width:"24",height:"24",rx:"4",fill:"var(--accent)"}),e.jsx("text",{x:"12",y:"17",textAnchor:"middle",fill:"white",fontSize:"14",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"U"})]}),e.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Dev Console"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:x,className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},title:`Switch to ${c==="dark"?"light":"dark"} theme`,children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c==="dark"?e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"5"}),e.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),e.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),e.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),e.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),e.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),e.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),e.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),e.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):e.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),e.jsx("button",{onClick:a,className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsx("button",{onClick:o,className:"mx-3 mt-2.5 mb-1 px-2 py-1.5 text-[10px] uppercase tracking-wider font-semibold rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-muted)"},children:"+ New Run"}),e.jsx("div",{className:"px-3 pt-3 pb-1 text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.map(l=>e.jsx(me,{run:l,isSelected:l.id===s,onClick:()=>r(l.id)},l.id)),u.length===0&&e.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]}),e.jsx("div",{className:"px-3 h-10 border-t border-[var(--border)] flex items-center justify-center",children:e.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-[11px] uppercase tracking-widest font-semibold transition-opacity hover:opacity-80",style:{color:"var(--text-muted)"},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),"GitHub"]})})]})]}):null:e.jsxs("aside",{className:"w-44 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[e.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[e.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 cursor-pointer transition-opacity hover:opacity-80",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("rect",{width:"24",height:"24",rx:"4",fill:"var(--accent)"}),e.jsx("text",{x:"12",y:"17",textAnchor:"middle",fill:"white",fontSize:"14",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"U"})]}),e.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Dev Console"})]}),e.jsx("button",{onClick:x,className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-muted)"},title:`Switch to ${c==="dark"?"light":"dark"} theme`,children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c==="dark"?e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"5"}),e.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),e.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),e.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),e.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),e.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),e.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),e.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),e.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):e.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})})]}),e.jsx("button",{onClick:o,className:"mx-3 mt-2.5 mb-1 px-2 py-1 text-[10px] uppercase tracking-wider font-semibold rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-muted)",l.currentTarget.style.borderColor="var(--border)"},children:"+ New Run"}),e.jsx("div",{className:"px-3 pt-3 pb-1 text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.map(l=>e.jsx(me,{run:l,isSelected:l.id===s,onClick:()=>r(l.id)},l.id)),u.length===0&&e.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]}),e.jsx("div",{className:"px-3 h-10 border-t border-[var(--border)] flex items-center justify-center",children:e.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-[11px] uppercase tracking-widest font-semibold transition-opacity hover:opacity-80",style:{color:"var(--text-muted)"},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),"GitHub"]})})]})}function vt(){const{navigate:t}=Pe(),s=H(u=>u.entrypoints),[r,o]=p.useState(""),[n,i]=p.useState(!0),[a,c]=p.useState(null);p.useEffect(()=>{!r&&s.length>0&&o(s[0])},[s,r]),p.useEffect(()=>{r&&(i(!0),c(null),at(r).then(u=>{var h;const l=(h=u.input)==null?void 0:h.properties;i(!!(l!=null&&l.messages))}).catch(u=>{const l=u.detail||{};c(l.error||l.message||`Failed to load entrypoint "${r}"`)}))},[r]);const x=u=>{r&&t(`#/setup/${encodeURIComponent(r)}/${u}`)};return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"w-full max-w-xl px-6",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:a?"var(--error)":"var(--accent)"}}),e.jsx("span",{className:"text-xs uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!a&&e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:s.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),s.length>1&&e.jsxs("div",{className:"mb-8",children:[e.jsx("label",{className:"block text-[10px] uppercase tracking-wider font-semibold mb-2",style:{color:"var(--text-muted)"},children:"Entrypoint"}),e.jsx("select",{value:r,onChange:u=>o(u.target.value),className:"w-full rounded-md px-3 py-1.5 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:s.map(u=>e.jsx("option",{value:u,children:u},u))})]}),a?e.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),e.jsx("div",{className:"overflow-auto max-h-48 p-3",children:e.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:a})})]}):e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(ge,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:e.jsx(yt,{}),color:"var(--success)",onClick:()=>x("run"),disabled:!r}),e.jsx(ge,{title:"Conversational",description:n?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:e.jsx(bt,{}),color:"var(--accent)",onClick:()=>x("chat"),disabled:!r||!n})]})]})})}function ge({title:t,description:s,icon:r,color:o,onClick:n,disabled:i}){return e.jsxs("button",{onClick:n,disabled:i,className:"group flex flex-col items-center text-center p-6 rounded-lg border transition-all cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:a=>{i||(a.currentTarget.style.borderColor=o,a.currentTarget.style.background=`color-mix(in srgb, ${o} 5%, var(--bg-secondary))`)},onMouseLeave:a=>{a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--bg-secondary)"},children:[e.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${o} 10%, var(--bg-primary))`,color:o},children:r}),e.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:t}),e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:s})]})}function yt(){return e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function bt(){return e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),e.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),e.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),e.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),e.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),e.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),e.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),e.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const jt="modulepreload",wt=function(t){return"/"+t},fe={},He=function(s,r,o){let n=Promise.resolve();if(r&&r.length>0){let a=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),x=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=a(r.map(u=>{if(u=wt(u),u in fe)return;fe[u]=!0;const l=u.endsWith(".css"),h=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const j=document.createElement("link");if(j.rel=l?"stylesheet":jt,l||(j.as="script"),j.crossOrigin="",j.href=u,x&&j.setAttribute("nonce",x),document.head.appendChild(j),l)return new Promise((b,E)=>{j.addEventListener("load",b),j.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return n.then(a=>{for(const c of a||[])c.status==="rejected"&&i(c.reason);return s().catch(i)})},kt={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Nt({data:t}){const s=t.status,r=t.nodeWidth,o=t.label??"Start",n=t.hasBreakpoint,i=t.isPausedHere,a=t.isActiveNode,c=t.isExecutingNode,x=i?"var(--error)":c?"var(--success)":a?"var(--accent)":s==="completed"?"var(--success)":s==="running"?"var(--warning)":"var(--node-border)",u=i?"var(--error)":c?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:r,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${x}`,boxShadow:i||a||c?`0 0 4px ${u}`:void 0,animation:i||a||c?`node-pulse-${i?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o,children:[n&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),o,e.jsx(Y,{type:"source",position:X.Bottom,style:kt})]})}const St={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Et({data:t}){const s=t.status,r=t.nodeWidth,o=t.label??"End",n=t.hasBreakpoint,i=t.isPausedHere,a=t.isActiveNode,c=t.isExecutingNode,x=i?"var(--error)":c?"var(--success)":a?"var(--accent)":s==="completed"?"var(--success)":s==="failed"?"var(--error)":"var(--node-border)",u=i?"var(--error)":c?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:r,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${x}`,boxShadow:i||a||c?`0 0 4px ${u}`:void 0,animation:i||a||c?`node-pulse-${i?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o,children:[n&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top,style:St}),o]})}const ve={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Ct({data:t}){const s=t.status,r=t.nodeWidth,o=t.model_name,n=t.label??"Model",i=t.hasBreakpoint,a=t.isPausedHere,c=t.isActiveNode,x=t.isExecutingNode,u=a?"var(--error)":x?"var(--success)":c?"var(--accent)":s==="completed"?"var(--success)":s==="running"?"var(--warning)":s==="failed"?"var(--error)":"var(--node-border)",l=a?"var(--error)":x?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:r,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:a||c||x?`0 0 4px ${l}`:void 0,animation:a||c||x?`node-pulse-${a?"red":x?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o?`${n}
-${o}`:n,children:[i&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top,style:ve}),e.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n}),o&&e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:o,children:o}),e.jsx(Y,{type:"source",position:X.Bottom,style:ve})]})}const ye={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},_t=3;function Lt({data:t}){const s=t.status,r=t.nodeWidth,o=t.tool_names,n=t.tool_count,i=t.label??"Tool",a=t.hasBreakpoint,c=t.isPausedHere,x=t.isActiveNode,u=t.isExecutingNode,l=c?"var(--error)":u?"var(--success)":x?"var(--accent)":s==="completed"?"var(--success)":s==="running"?"var(--warning)":s==="failed"?"var(--error)":"var(--node-border)",h=c?"var(--error)":u?"var(--success)":"var(--accent)",j=(o==null?void 0:o.slice(0,_t))??[],b=(n??(o==null?void 0:o.length)??0)-j.length;return e.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:r,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${l}`,boxShadow:c||x||u?`0 0 4px ${h}`:void 0,animation:c||x||u?`node-pulse-${c?"red":u?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o!=null&&o.length?`${i}
-
-${o.join(`
-`)}`:i,children:[a&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top,style:ye}),e.jsxs("div",{style:{color:"var(--warning)",fontSize:9,marginBottom:1},children:["tools",n?` (${n})`:""]}),e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:i}),j.length>0&&e.jsxs("div",{style:{marginTop:3,fontSize:9,color:"var(--text-muted)",textAlign:"left"},children:[j.map(E=>e.jsx("div",{className:"truncate",children:E},E)),b>0&&e.jsxs("div",{style:{fontStyle:"italic"},children:["+",b," more"]})]}),e.jsx(Y,{type:"source",position:X.Bottom,style:ye})]})}const be={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Tt({data:t}){const s=t.label??"",r=t.status,o=t.hasBreakpoint,n=t.isPausedHere,i=t.isActiveNode,a=t.isExecutingNode,c=n?"var(--error)":a?"var(--success)":i?"var(--accent)":r==="completed"?"var(--success)":r==="running"?"var(--warning)":r==="failed"?"var(--error)":"var(--bg-tertiary)",x=n?"var(--error)":a?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"relative cursor-pointer",style:{width:"100%",height:"100%",background:"var(--bg-secondary)",border:`1.5px ${n||i||a?"solid":"dashed"} ${c}`,borderRadius:8,boxShadow:n||i||a?`0 0 4px ${x}`:void 0,animation:n||i||a?`node-pulse-${n?"red":a?"green":"accent"} 1.5s ease-in-out infinite`:void 0},children:[o&&e.jsx("div",{className:"absolute",style:{top:4,left:4,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--bg-tertiary)",boxShadow:"0 0 4px var(--error)",zIndex:1}}),e.jsx(Y,{type:"target",position:X.Top,style:be}),e.jsx("div",{style:{padding:"4px 10px",fontSize:10,color:"var(--text-muted)",fontWeight:600,textAlign:"center",borderBottom:`1px solid ${c}`,background:"var(--bg-tertiary)",borderRadius:"8px 8px 0 0"},children:s}),e.jsx(Y,{type:"source",position:X.Bottom,style:be})]})}function Mt({data:t}){const s=t.status,r=t.nodeWidth,o=t.label??"",n=t.hasBreakpoint,i=t.isPausedHere,a=t.isActiveNode,c=t.isExecutingNode,x=i?"var(--error)":c?"var(--success)":a?"var(--accent)":s==="completed"?"var(--success)":s==="running"?"var(--warning)":s==="failed"?"var(--error)":"var(--node-border)",u=i?"var(--error)":c?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:r,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${x}`,boxShadow:i||a||c?`0 0 4px ${u}`:void 0,animation:i||a||c?`node-pulse-${i?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o,children:[n&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top}),e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:o}),e.jsx(Y,{type:"source",position:X.Bottom})]})}function Rt(t,s=8){if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let r=`M ${t[0].x} ${t[0].y}`;for(let n=1;n0&&(r+=Math.min(o.length,3)*12+(o.length>3?12:0)+4),t!=null&&t.model_name&&(r+=14),r}let ce=null;async function At(){if(!ce){const{default:t}=await He(async()=>{const{default:s}=await import("./vendor-elk-CTNP4r_q.js").then(r=>r.e);return{default:s}},__vite__mapDeps([0,1]));ce=new t}return ce}const ke={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.spacing.nodeNode":"25","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.spacing.edgeNode":"30","elk.spacing.edgeEdge":"15","elk.layered.spacing.edgeNodeBetweenLayers":"25","elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.portAlignment.default":"CENTER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},Bt="[top=35,left=15,bottom=15,right=15]";function Dt(t){const s=[],r=[];for(const o of t.nodes){const n=o.data,i={id:o.id,width:je(n),height:we(n,o.type)};if(o.data.subgraph){const a=o.data.subgraph;delete i.width,delete i.height,i.layoutOptions={...ke,"elk.padding":Bt},i.children=a.nodes.map(c=>({id:`${o.id}/${c.id}`,width:je(c.data),height:we(c.data,c.type)})),i.edges=a.edges.map(c=>({id:`${o.id}/${c.id}`,sources:[`${o.id}/${c.source}`],targets:[`${o.id}/${c.target}`]}))}s.push(i)}for(const o of t.edges)r.push({id:o.id,sources:[o.source],targets:[o.target]});return{id:"root",layoutOptions:ke,children:s,edges:r}}const de={type:Je.ArrowClosed,width:12,height:12,color:"var(--node-border)"};function Ae(t){return{stroke:"var(--node-border)",strokeWidth:1.5,...t?{strokeDasharray:"6 3"}:{}}}function Ne(t,s,r,o,n){var u;const i=(u=t.sections)==null?void 0:u[0],a=(n==null?void 0:n.x)??0,c=(n==null?void 0:n.y)??0;let x;if(i)x={sourcePoint:{x:i.startPoint.x+a,y:i.startPoint.y+c},targetPoint:{x:i.endPoint.x+a,y:i.endPoint.y+c},bendPoints:(i.bendPoints??[]).map(l=>({x:l.x+a,y:l.y+c}))};else{const l=s.get(t.sources[0]),h=s.get(t.targets[0]);l&&h&&(x={sourcePoint:{x:l.x+l.width/2,y:l.y+l.height},targetPoint:{x:h.x+h.width/2,y:h.y},bendPoints:[]})}return{id:t.id,source:t.sources[0],target:t.targets[0],type:"elk",data:x,style:Ae(o),markerEnd:de,...r?{label:r,labelStyle:{fill:"var(--text-muted)",fontSize:10},labelBgStyle:{fill:"var(--bg-primary)",fillOpacity:.8}}:{}}}async function zt(t){var x,u;const s=Dt(t),o=await(await At()).layout(s),n=new Map;for(const l of t.nodes)if(n.set(l.id,{type:l.type,data:l.data}),l.data.subgraph)for(const h of l.data.subgraph.nodes)n.set(`${l.id}/${h.id}`,{type:h.type,data:h.data});const i=[],a=[],c=new Map;for(const l of o.children??[]){const h=l.x??0,j=l.y??0;c.set(l.id,{x:h,y:j,width:l.width??0,height:l.height??0});for(const b of l.children??[])c.set(b.id,{x:h+(b.x??0),y:j+(b.y??0),width:b.width??0,height:b.height??0})}for(const l of o.children??[]){const h=n.get(l.id);if((((x=l.children)==null?void 0:x.length)??0)>0){i.push({id:l.id,type:"groupNode",data:{...(h==null?void 0:h.data)??{},nodeWidth:l.width,nodeHeight:l.height},position:{x:l.x??0,y:l.y??0},style:{width:l.width,height:l.height}});for(const k of l.children??[]){const w=n.get(k.id);i.push({id:k.id,type:(w==null?void 0:w.type)??"defaultNode",data:{...(w==null?void 0:w.data)??{},nodeWidth:k.width},position:{x:k.x??0,y:k.y??0},parentNode:l.id,extent:"parent"})}const b=l.x??0,E=l.y??0;for(const k of l.edges??[]){const w=t.nodes.find(B=>B.id===l.id),R=(u=w==null?void 0:w.data.subgraph)==null?void 0:u.edges.find(B=>`${l.id}/${B.id}`===k.id);a.push(Ne(k,c,R==null?void 0:R.label,R==null?void 0:R.conditional,{x:b,y:E}))}}else i.push({id:l.id,type:(h==null?void 0:h.type)??"defaultNode",data:{...(h==null?void 0:h.data)??{},nodeWidth:l.width},position:{x:l.x??0,y:l.y??0}})}for(const l of o.edges??[]){const h=t.edges.find(j=>j.id===l.id);a.push(Ne(l,c,h==null?void 0:h.label,h==null?void 0:h.conditional))}return{nodes:i,edges:a}}function ae({entrypoint:t,runId:s,breakpointNode:r,breakpointNextNodes:o,onBreakpointChange:n,fitViewTrigger:i}){const[a,c,x]=Ge([]),[u,l,h]=qe([]),[j,b]=p.useState(!0),[E,k]=p.useState(!1),[w,R]=p.useState(0),B=p.useRef(0),J=p.useRef(null),V=H(y=>y.breakpoints[s]),N=H(y=>y.toggleBreakpoint),L=H(y=>y.clearBreakpoints),W=H(y=>y.activeNodes[s]),D=H(y=>{var d;return(d=y.runs[s])==null?void 0:d.status}),G=p.useCallback((y,d)=>{if(d.type==="startNode"||d.type==="endNode")return;const g=d.type==="groupNode"?d.id:d.id.includes("/")?d.id.split("/").pop():d.id;N(s,g);const P=H.getState().breakpoints[s]??{};n==null||n(Object.keys(P))},[s,N,n]),z=V&&Object.keys(V).length>0,q=p.useCallback(()=>{if(z)L(s),n==null||n([]);else{const y=[];for(const g of a){if(g.type==="startNode"||g.type==="endNode"||g.parentNode)continue;const P=g.type==="groupNode"?g.id:g.id.includes("/")?g.id.split("/").pop():g.id;y.push(P)}for(const g of y)V!=null&&V[g]||N(s,g);const d=H.getState().breakpoints[s]??{};n==null||n(Object.keys(d))}},[s,z,V,a,L,N,n]);p.useEffect(()=>{c(y=>y.map(d=>{var m;if(d.type==="startNode"||d.type==="endNode")return d;const g=d.type==="groupNode"?d.id:d.id.includes("/")?d.id.split("/").pop():d.id,P=!!(V&&V[g]);return P!==!!((m=d.data)!=null&&m.hasBreakpoint)?{...d,data:{...d.data,hasBreakpoint:P}}:d}))},[V,c]),p.useEffect(()=>{const y=r?new Set(r.split(",").map(d=>d.trim()).filter(Boolean)):null;c(d=>d.map(g=>{var $,f;if(g.type==="startNode"||g.type==="endNode")return g;const P=g.type==="groupNode"?g.id:g.id.includes("/")?g.id.split("/").pop():g.id,m=($=g.data)==null?void 0:$.label,S=y!=null&&(y.has(P)||m!=null&&y.has(m));return S!==!!((f=g.data)!=null&&f.isPausedHere)?{...g,data:{...g.data,isPausedHere:S}}:g}))},[r,w,c]);const M=H(y=>y.stateEvents[s]);p.useEffect(()=>{const y=!!r;let d=new Set;const g=new Set,P=new Set,m=new Set,S=new Map,$=new Map;if(M)for(const f of M)f.phase==="started"?$.set(f.node_name,f.qualified_node_name??null):f.phase==="completed"&&$.delete(f.node_name);c(f=>{var C;for(const O of f)O.type&&S.set(O.id,O.type);const _=O=>{var v;const A=[];for(const T of f){const F=T.type==="groupNode"?T.id:T.id.includes("/")?T.id.split("/").pop():T.id,U=(v=T.data)==null?void 0:v.label;(F===O||U!=null&&U===O)&&A.push(T.id)}return A};if(y&&r){const O=r.split(",").map(A=>A.trim()).filter(Boolean);for(const A of O)_(A).forEach(v=>d.add(v));if(o!=null&&o.length)for(const A of o)_(A).forEach(v=>P.add(v));W!=null&&W.prev&&_(W.prev).forEach(A=>g.add(A))}else if($.size>0){const O=new Map;for(const A of f){const v=(C=A.data)==null?void 0:C.label;if(!v)continue;const T=A.id.includes("/")?A.id.split("/").pop():A.id;for(const F of[T,v]){let U=O.get(F);U||(U=new Set,O.set(F,U)),U.add(A.id)}}for(const[A,v]of $){let T=!1;if(v){const F=v.replace(/:/g,"/");for(const U of f)U.id===F&&(d.add(U.id),T=!0)}if(!T){const F=O.get(A);F&&F.forEach(U=>d.add(U))}}}return f}),l(f=>{const _=g.size===0||f.some(C=>d.has(C.target)&&g.has(C.source));return f.map(C=>{var A,v;let O;return y?O=d.has(C.target)&&(g.size===0||!_||g.has(C.source))||d.has(C.source)&&P.has(C.target):(O=d.has(C.source),!O&&S.get(C.target)==="endNode"&&d.has(C.target)&&(O=!0)),O?(y||m.add(C.target),{...C,style:{stroke:"var(--accent)",strokeWidth:2.5},markerEnd:{...de,color:"var(--accent)"},data:{...C.data,highlighted:!0},animated:!0}):(A=C.data)!=null&&A.highlighted?{...C,style:Ae((v=C.data)==null?void 0:v.conditional),markerEnd:de,data:{...C.data,highlighted:!1},animated:!1}:C})}),c(f=>f.map(_=>{var A,v,T,F;const C=!y&&d.has(_.id);if(_.type==="startNode"||_.type==="endNode"){const U=m.has(_.id)||!y&&d.has(_.id);return U!==!!((A=_.data)!=null&&A.isActiveNode)||C!==!!((v=_.data)!=null&&v.isExecutingNode)?{..._,data:{..._.data,isActiveNode:U,isExecutingNode:C}}:_}const O=y?P.has(_.id):m.has(_.id);return O!==!!((T=_.data)!=null&&T.isActiveNode)||C!==!!((F=_.data)!=null&&F.isExecutingNode)?{..._,data:{..._.data,isActiveNode:O,isExecutingNode:C}}:_}))},[M,W,r,o,D,w,c,l]);const I=H(y=>y.graphCache[s]);return p.useEffect(()=>{if(!I&&s!=="__setup__")return;const y=I?Promise.resolve(I):ct(t),d=++B.current;b(!0),k(!1),y.then(async g=>{if(B.current!==d)return;if(!g.nodes.length){k(!0);return}const{nodes:P,edges:m}=await zt(g);if(B.current!==d)return;const S=H.getState().breakpoints[s],$=S?P.map(f=>{if(f.type==="startNode"||f.type==="endNode")return f;const _=f.type==="groupNode"?f.id:f.id.includes("/")?f.id.split("/").pop():f.id;return S[_]?{...f,data:{...f.data,hasBreakpoint:!0}}:f}):P;c($),l(m),R(f=>f+1),setTimeout(()=>{var f;(f=J.current)==null||f.fitView({padding:.1,duration:200})},100)}).catch(()=>{B.current===d&&k(!0)}).finally(()=>{B.current===d&&b(!1)})},[t,s,I,c,l]),p.useEffect(()=>{const y=setTimeout(()=>{var d;(d=J.current)==null||d.fitView({padding:.1,duration:200})},100);return()=>clearTimeout(y)},[s]),p.useEffect(()=>{var y;i&&((y=J.current)==null||y.fitView({padding:.1,duration:200}))},[i]),p.useEffect(()=>{c(y=>{var C,O,A;const d=!!(M!=null&&M.length),g=D==="completed"||D==="failed",P=new Set,m=new Set(y.map(v=>v.id)),S=new Map;for(const v of y){const T=(C=v.data)==null?void 0:C.label;if(!T)continue;const F=v.id.includes("/")?v.id.split("/").pop():v.id;for(const U of[F,T]){let se=S.get(U);se||(se=new Set,S.set(U,se)),se.add(v.id)}}if(d)for(const v of M){let T=!1;if(v.qualified_node_name){const F=v.qualified_node_name.replace(/:/g,"/");m.has(F)&&(P.add(F),T=!0)}if(!T){const F=S.get(v.node_name);F&&F.forEach(U=>P.add(U))}}const $=new Set;for(const v of y)v.parentNode&&P.has(v.id)&&$.add(v.parentNode);let f;D==="failed"&&P.size===0&&(f=(O=y.find(v=>!v.parentNode&&v.type!=="startNode"&&v.type!=="endNode"&&v.type!=="groupNode"))==null?void 0:O.id);let _;if(D==="completed"){const v=(A=y.find(T=>!T.parentNode&&T.type!=="startNode"&&T.type!=="endNode"&&T.type!=="groupNode"))==null?void 0:A.id;v&&!P.has(v)&&(_=v)}return y.map(v=>{var F;let T;return v.id===f?T="failed":v.id===_||P.has(v.id)?T="completed":v.type==="startNode"?(!v.parentNode&&d||v.parentNode&&$.has(v.parentNode))&&(T="completed"):v.type==="endNode"?!v.parentNode&&g?T=D==="failed"?"failed":"completed":v.parentNode&&$.has(v.parentNode)&&(T="completed"):v.type==="groupNode"&&$.has(v.id)&&(T="completed"),T!==((F=v.data)==null?void 0:F.status)?{...v,data:{...v.data,status:T}}:v})})},[M,D,w,c]),j?e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:"Loading graph..."}):E?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",style:{color:"var(--text-muted)"},children:[e.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"38",y:"10",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"}),e.jsx("line",{x1:"60",y1:"34",x2:"60",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("rect",{x:"12",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("rect",{x:"64",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"60",y1:"46",x2:"34",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"60",y1:"46",x2:"86",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"34",y1:"70",x2:"34",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"86",y1:"70",x2:"86",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"34",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"86",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"60",y1:"82",x2:"60",y2:"86",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("rect",{x:"38",y:"86",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"})]}),e.jsx("span",{className:"text-xs",children:"No graph schema available"})]}):e.jsxs("div",{className:"h-full graph-panel",children:[e.jsx("style",{children:`
- .graph-panel .react-flow__handle {
- opacity: 0 !important;
- width: 0 !important;
- height: 0 !important;
- min-width: 0 !important;
- min-height: 0 !important;
- border: none !important;
- pointer-events: none !important;
- }
- .graph-panel .react-flow__edges {
- overflow: visible !important;
- z-index: 1 !important;
- }
- .graph-panel .react-flow__edge.animated path {
- stroke-dasharray: 8 4;
- animation: edge-flow 0.6s linear infinite;
- }
- @keyframes edge-flow {
- to { stroke-dashoffset: -12; }
- }
- @keyframes node-pulse-accent {
- 0%, 100% { box-shadow: 0 0 4px var(--accent); }
- 50% { box-shadow: 0 0 10px var(--accent); }
- }
- @keyframes node-pulse-green {
- 0%, 100% { box-shadow: 0 0 4px var(--success); }
- 50% { box-shadow: 0 0 10px var(--success); }
- }
- @keyframes node-pulse-red {
- 0%, 100% { box-shadow: 0 0 4px var(--error); }
- 50% { box-shadow: 0 0 10px var(--error); }
- }
- `}),e.jsxs(Ye,{nodes:a,edges:u,onNodesChange:x,onEdgesChange:h,nodeTypes:It,edgeTypes:Pt,onInit:y=>{J.current=y},onNodeClick:G,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[e.jsx(Xe,{color:"var(--bg-tertiary)",gap:16}),e.jsx(Ke,{showInteractive:!1}),e.jsx(Ze,{position:"top-right",children:e.jsxs("button",{onClick:q,title:z?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:z?"var(--error)":"var(--text-muted)",border:`1px solid ${z?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[e.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:z?"var(--error)":"var(--node-border)"}}),z?"Clear all":"Break all"]})}),e.jsx(Qe,{nodeColor:y=>{var g;if(y.type==="groupNode")return"var(--bg-tertiary)";const d=(g=y.data)==null?void 0:g.status;return d==="completed"?"var(--success)":d==="running"?"var(--warning)":d==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const ee="__setup__";function Vt({entrypoint:t,mode:s,ws:r,onRunCreated:o,isMobile:n}){const[i,a]=p.useState("{}"),[c,x]=p.useState({}),[u,l]=p.useState(!1),[h,j]=p.useState(!0),[b,E]=p.useState(null),[k,w]=p.useState(""),[R,B]=p.useState(0),[J,V]=p.useState(!0),[N,L]=p.useState(()=>{const m=localStorage.getItem("setupTextareaHeight");return m?parseInt(m,10):140}),W=p.useRef(null),[D,G]=p.useState(()=>{const m=localStorage.getItem("setupPanelWidth");return m?parseInt(m,10):380}),z=s==="run";p.useEffect(()=>{j(!0),E(null),it(t).then(m=>{x(m.mock_input),a(JSON.stringify(m.mock_input,null,2))}).catch(m=>{console.error("Failed to load mock input:",m);const S=m.detail||{};E(S.message||`Failed to load schema for "${t}"`),a("{}")}).finally(()=>j(!1))},[t]),p.useEffect(()=>{H.getState().clearBreakpoints(ee)},[]);const q=async()=>{let m;try{m=JSON.parse(i)}catch{alert("Invalid JSON input");return}l(!0);try{const S=H.getState().breakpoints[ee]??{},$=Object.keys(S),f=await he(t,m,s,$);H.getState().clearBreakpoints(ee),H.getState().upsertRun(f),o(f.id)}catch(S){console.error("Failed to create run:",S)}finally{l(!1)}},M=async()=>{const m=k.trim();if(m){l(!0);try{const S=H.getState().breakpoints[ee]??{},$=Object.keys(S),f=await he(t,c,"chat",$);H.getState().clearBreakpoints(ee),H.getState().upsertRun(f),H.getState().addLocalChatMessage(f.id,{message_id:`local-${Date.now()}`,role:"user",content:m}),r.sendChatMessage(f.id,m),o(f.id)}catch(S){console.error("Failed to create chat run:",S)}finally{l(!1)}}};p.useEffect(()=>{try{JSON.parse(i),V(!0)}catch{V(!1)}},[i]);const I=p.useCallback(m=>{m.preventDefault();const S="touches"in m?m.touches[0].clientY:m.clientY,$=N,f=C=>{const O="touches"in C?C.touches[0].clientY:C.clientY,A=Math.max(60,$+(S-O));L(A)},_=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",f),document.removeEventListener("touchend",_),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(N))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",f),document.addEventListener("mouseup",_),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("touchend",_)},[N]),y=p.useCallback(m=>{m.preventDefault();const S="touches"in m?m.touches[0].clientX:m.clientX,$=D,f=C=>{const O=W.current;if(!O)return;const A="touches"in C?C.touches[0].clientX:C.clientX,v=O.clientWidth-300,T=Math.max(280,Math.min(v,$+(S-A)));G(T)},_=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",f),document.removeEventListener("touchend",_),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(D)),B(C=>C+1)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",f),document.addEventListener("mouseup",_),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("touchend",_)},[D]),d=z?"Autonomous":"Conversational",g=z?"var(--success)":"var(--accent)",P=e.jsxs("div",{className:"shrink-0 flex flex-col",style:n?{background:"var(--bg-primary)"}:{width:D,background:"var(--bg-primary)"},children:[e.jsxs("div",{className:"px-4 text-xs font-semibold uppercase tracking-wider border-b flex items-center gap-2 h-[33px]",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[e.jsx("span",{style:{color:g},children:"●"}),d]}),e.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[e.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:z?e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}):e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),e.jsxs("div",{className:"text-center space-y-1.5",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:z?"Ready to execute":"Ready to chat"}),e.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",z?e.jsxs(e.Fragment,{children:[",",e.jsx("br",{}),"configure input below, then run"]}):e.jsxs(e.Fragment,{children:[",",e.jsx("br",{}),"then send your first message"]})]})]})]}),z?e.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!n&&e.jsx("div",{onMouseDown:I,onTouchStart:I,className:"shrink-0 h-1.5 cursor-row-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors"}),e.jsxs("div",{className:"px-4 py-3",children:[b?e.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:b}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block text-[10px] uppercase tracking-wider font-semibold mb-2",style:{color:"var(--text-muted)"},children:["Input",h&&e.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),e.jsx("textarea",{value:i,onChange:m=>a(m.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none focus:outline-none mb-3",style:{height:n?120:N,background:"var(--bg-secondary)",border:`1px solid ${J?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),e.jsx("button",{onClick:q,disabled:u||h||!!b,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:g,color:g},onMouseEnter:m=>{u||(m.currentTarget.style.background=`color-mix(in srgb, ${g} 10%, transparent)`)},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:u?"Starting...":e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:k,onChange:m=>w(m.target.value),onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),M())},disabled:u||h,placeholder:u?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 focus:outline-none disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:M,disabled:u||h||!k.trim(),className:"text-[11px] uppercase tracking-wider font-semibold px-2 py-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!u&&k.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:m=>{!u&&k.trim()&&(m.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:"Send"})]})]});return n?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:e.jsx(ae,{entrypoint:t,traces:[],runId:ee,fitViewTrigger:R})}),e.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:P})]}):e.jsxs("div",{ref:W,className:"flex h-full",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ae,{entrypoint:t,traces:[],runId:ee,fitViewTrigger:R})}),e.jsx("div",{onMouseDown:y,onTouchStart:y,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:e.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),P]})}const Ft={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function Ut(t){const s=[],r=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let o=0,n;for(;(n=r.exec(t))!==null;){if(n.index>o&&s.push({type:"punctuation",text:t.slice(o,n.index)}),n[1]!==void 0){s.push({type:"key",text:n[1]});const i=t.indexOf(":",n.index+n[1].length);i!==-1&&(i>n.index+n[1].length&&s.push({type:"punctuation",text:t.slice(n.index+n[1].length,i)}),s.push({type:"punctuation",text:":"}),r.lastIndex=i+1)}else n[2]!==void 0?s.push({type:"string",text:n[2]}):n[3]!==void 0?s.push({type:"number",text:n[3]}):n[4]!==void 0?s.push({type:"boolean",text:n[4]}):n[5]!==void 0?s.push({type:"null",text:n[5]}):n[6]!==void 0&&s.push({type:"punctuation",text:n[6]});o=r.lastIndex}return oUt(t),[t]);return e.jsx("pre",{className:s,style:r,children:o.map((n,i)=>e.jsx("span",{style:{color:Ft[n.type]},children:n.text},i))})}const Jt={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},Gt={color:"var(--text-muted)",label:"Unknown"};function qt(t){if(typeof t!="string")return null;const s=t.trim();if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{return JSON.stringify(JSON.parse(s),null,2)}catch{return null}return null}function Yt(t){if(t<1)return`${(t*1e3).toFixed(0)}us`;if(t<1e3)return`${t.toFixed(2)}ms`;if(t<6e4)return`${(t/1e3).toFixed(2)}s`;const s=Math.floor(t/6e4),r=(t%6e4/1e3).toFixed(1);return`${s}m ${r}s`}const Se=200;function Xt(t){if(typeof t=="string")return t;if(t==null)return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function Kt({value:t}){const[s,r]=p.useState(!1),o=Xt(t),n=p.useMemo(()=>qt(t),[t]),i=n!==null,a=n??o,c=a.length>Se||a.includes(`
-`),x=p.useCallback(()=>r(u=>!u),[]);return c?e.jsxs("div",{children:[s?i?e.jsx(te,{json:a,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):e.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:a}):e.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[a.slice(0,Se),"..."]}),e.jsx("button",{onClick:x,className:"text-[10px] cursor-pointer ml-1",style:{color:"var(--info)"},children:s?"[less]":"[more]"})]}):i?e.jsx(te,{json:a,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):e.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:a})}function Zt({span:t}){const[s,r]=p.useState(!0),[o,n]=p.useState(!1),i=Jt[t.status.toLowerCase()]??{...Gt,label:t.status},a=new Date(t.timestamp).toLocaleTimeString(void 0,{hour12:!1,fractionalSecondDigits:3}),c=Object.entries(t.attributes),x=[{label:"Span",value:t.span_id},...t.trace_id?[{label:"Trace",value:t.trace_id}]:[],{label:"Run",value:t.run_id},...t.parent_span_id?[{label:"Parent",value:t.parent_span_id}]:[]];return e.jsxs("div",{className:"overflow-y-auto h-full text-xs leading-normal",children:[e.jsxs("div",{className:"px-2 py-1.5 border-b flex items-center gap-2 flex-wrap",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[e.jsx("span",{className:"text-xs font-semibold mr-auto",style:{color:"var(--text-primary)"},children:t.span_name}),e.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${i.color} 15%, var(--bg-secondary))`,color:i.color},children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:i.color}}),i.label]}),t.duration_ms!=null&&e.jsx("span",{className:"shrink-0 font-mono text-[11px] font-semibold",style:{color:"var(--warning)"},children:Yt(t.duration_ms)}),e.jsx("span",{className:"shrink-0 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:a})]}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--accent)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>r(u=>!u),children:[e.jsxs("span",{className:"flex-1",children:["Attributes (",c.length,")"]}),e.jsx("span",{style:{color:"var(--text-muted)",transform:s?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),s&&c.map(([u,l],h)=>e.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:h%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[e.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:u,children:u}),e.jsx("span",{className:"flex-1 min-w-0",children:e.jsx(Kt,{value:l})})]},u))]}),e.jsxs("div",{className:"px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--accent)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(u=>!u),children:[e.jsxs("span",{className:"flex-1",children:["Identifiers (",x.length,")"]}),e.jsx("span",{style:{color:"var(--text-muted)",transform:o?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),o&&x.map((u,l)=>e.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:l%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[e.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:u.label,children:u.label}),e.jsx("span",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:u.value})})]},u.label))]})}const Qt={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function es({kind:t,statusColor:s}){const r=s,o=14,n={width:o,height:o,viewBox:"0 0 16 16",fill:"none",stroke:r,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(t){case"LLM":return e.jsx("svg",{...n,children:e.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:r,stroke:"none"})});case"TOOL":return e.jsx("svg",{...n,children:e.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return e.jsxs("svg",{...n,children:[e.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),e.jsx("circle",{cx:"6",cy:"9",r:"1",fill:r,stroke:"none"}),e.jsx("circle",{cx:"10",cy:"9",r:"1",fill:r,stroke:"none"}),e.jsx("path",{d:"M8 2v3"}),e.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return e.jsxs("svg",{...n,children:[e.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),e.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),e.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return e.jsxs("svg",{...n,children:[e.jsx("circle",{cx:"7",cy:"7",r:"4"}),e.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return e.jsxs("svg",{...n,children:[e.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),e.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),e.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),e.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return e.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:s}})}}function ts(t){const s=new Map(t.map(a=>[a.span_id,a])),r=new Map;for(const a of t)if(a.parent_span_id){const c=r.get(a.parent_span_id)??[];c.push(a),r.set(a.parent_span_id,c)}const o=t.filter(a=>a.parent_span_id===null||!s.has(a.parent_span_id));function n(a){const c=(r.get(a.span_id)??[]).sort((x,u)=>x.timestamp.localeCompare(u.timestamp));return{span:a,children:c.map(n)}}return o.sort((a,c)=>a.timestamp.localeCompare(c.timestamp)).map(n).flatMap(a=>a.span.span_name==="root"?a.children:[a])}function ss(t){return t==null?"":t<1e3?`${t.toFixed(0)}ms`:`${(t/1e3).toFixed(2)}s`}function Be(t){return t.map(s=>{const{span:r}=s;return s.children.length>0?{name:r.span_name,children:Be(s.children)}:{name:r.span_name}})}function Ee({traces:t}){const[s,r]=p.useState(null),[o,n]=p.useState(new Set),[i,a]=p.useState(()=>{const N=localStorage.getItem("traceTreeSplitWidth");return N?parseFloat(N):50}),[c,x]=p.useState(!1),[u,l]=p.useState(!1),h=ts(t),j=p.useMemo(()=>JSON.stringify(Be(h),null,2),[t]),b=p.useCallback(()=>{navigator.clipboard.writeText(j).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},[j]),E=H(N=>N.focusedSpan),k=H(N=>N.setFocusedSpan),[w,R]=p.useState(null),B=p.useRef(null),J=p.useCallback(N=>{n(L=>{const W=new Set(L);return W.has(N)?W.delete(N):W.add(N),W})},[]);p.useEffect(()=>{if(s===null)h.length>0&&r(h[0].span);else{const N=t.find(L=>L.span_id===s.span_id);N&&N!==s&&r(N)}},[t]),p.useEffect(()=>{if(!E)return;const L=t.filter(W=>W.span_name===E.name).sort((W,D)=>W.timestamp.localeCompare(D.timestamp))[E.index];if(L){r(L),R(L.span_id);const W=new Map(t.map(D=>[D.span_id,D.parent_span_id]));n(D=>{const G=new Set(D);let z=L.parent_span_id;for(;z;)G.delete(z),z=W.get(z)??null;return G})}k(null)},[E,t,k]),p.useEffect(()=>{if(!w)return;const N=w;R(null),requestAnimationFrame(()=>{const L=B.current,W=L==null?void 0:L.querySelector(`[data-span-id="${N}"]`);L&&W&&W.scrollIntoView({block:"center",behavior:"smooth"})})},[w]),p.useEffect(()=>{if(!c)return;const N=W=>{const D=document.querySelector(".trace-tree-container");if(!D)return;const G=D.getBoundingClientRect(),z=(W.clientX-G.left)/G.width*100,q=Math.max(20,Math.min(80,z));a(q),localStorage.setItem("traceTreeSplitWidth",String(q))},L=()=>{x(!1)};return window.addEventListener("mousemove",N),window.addEventListener("mouseup",L),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",L)}},[c]);const V=N=>{N.preventDefault(),x(!0)};return e.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:c?"col-resize":void 0},children:[e.jsxs("div",{className:"pr-0.5 pt-0.5 relative",style:{width:`${i}%`},children:[t.length>0&&e.jsx("button",{onClick:b,className:"absolute top-2 left-2 z-20 text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-opacity",style:{opacity:u?1:.3,color:u?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:N=>{N.currentTarget.style.opacity="1"},onMouseLeave:N=>{u||(N.currentTarget.style.opacity="0.3")},children:u?"Copied!":"Copy JSON"}),e.jsx("div",{ref:B,className:"overflow-y-auto h-full p-0.5",children:h.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):h.map((N,L)=>e.jsx(De,{node:N,depth:0,selectedId:(s==null?void 0:s.span_id)??null,onSelect:r,isLast:L===h.length-1,collapsedIds:o,toggleExpanded:J},N.span.span_id))})]}),e.jsx("div",{onMouseDown:V,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",style:c?{background:"var(--accent)"}:void 0,children:e.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),e.jsx("div",{className:"flex-1 overflow-hidden p-0.5",children:s?e.jsx(Zt,{span:s}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function De({node:t,depth:s,selectedId:r,onSelect:o,isLast:n,collapsedIds:i,toggleExpanded:a}){var k;const{span:c}=t,x=!i.has(c.span_id),u=Qt[c.status.toLowerCase()]??"var(--text-muted)",l=ss(c.duration_ms),h=c.span_id===r,j=t.children.length>0,b=s*20,E=(k=c.attributes)==null?void 0:k["openinference.span.kind"];return e.jsxs("div",{className:"relative",children:[s>0&&e.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${b-10}px`,width:"1px",height:n?"16px":"100%",background:"var(--border)"}}),e.jsxs("button",{"data-span-id":c.span_id,onClick:()=>o(c),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${b+4}px`,background:h?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:h?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:w=>{h||(w.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:w=>{h||(w.currentTarget.style.background="")},children:[s>0&&e.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${b-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),j?e.jsx("span",{onClick:w=>{w.stopPropagation(),a(c.span_id)},className:"shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:x?"rotate(90deg)":"rotate(0deg)"},children:e.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):e.jsx("span",{className:"shrink-0 w-4"}),e.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:e.jsx(es,{kind:E,statusColor:u})}),e.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:c.span_name}),l&&e.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:l})]}),x&&t.children.map((w,R)=>e.jsx(De,{node:w,depth:s+1,selectedId:r,onSelect:o,isLast:R===t.children.length-1,collapsedIds:i,toggleExpanded:a},w.span.span_id))]})}const rs={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},os={color:"var(--text-muted)",bg:"transparent"};function Ce({logs:t}){const s=p.useRef(null),r=p.useRef(null),[o,n]=p.useState(!1);p.useEffect(()=>{var a;(a=r.current)==null||a.scrollIntoView({behavior:"smooth"})},[t.length]);const i=()=>{const a=s.current;a&&n(a.scrollTop>100)};return t.length===0?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):e.jsxs("div",{className:"h-full relative",children:[e.jsxs("div",{ref:s,onScroll:i,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[t.map((a,c)=>{const x=new Date(a.timestamp).toLocaleTimeString(void 0,{hour12:!1}),u=a.level.toUpperCase(),l=u.slice(0,4),h=rs[u]??os,j=c%2===0;return e.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:j?"var(--bg-primary)":"var(--bg-secondary)"},children:[e.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:x}),e.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:h.color,background:h.bg},children:l}),e.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:a.message})]},c)}),e.jsx("div",{ref:r})]}),o&&e.jsx("button",{onClick:()=>{var a;return(a=s.current)==null?void 0:a.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const ns={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},_e={color:"var(--text-muted)",label:""};function ne({events:t,runStatus:s}){const r=p.useRef(null),o=p.useRef(!0),[n,i]=p.useState(null),a=()=>{const c=r.current;c&&(o.current=c.scrollHeight-c.scrollTop-c.clientHeight<40)};return p.useEffect(()=>{o.current&&r.current&&(r.current.scrollTop=r.current.scrollHeight)}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:s==="running"?"Waiting for events...":"No events yet"})}):e.jsx("div",{ref:r,onScroll:a,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:t.map((c,x)=>{const u=new Date(c.timestamp).toLocaleTimeString(void 0,{hour12:!1}),l=c.payload&&Object.keys(c.payload).length>0,h=n===x,j=c.phase?ns[c.phase]??_e:_e;return e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>{l&&i(h?null:x)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:x%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:l?"pointer":"default"},children:[e.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:u}),e.jsx("span",{className:"shrink-0",style:{color:j.color},children:"●"}),e.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:c.node_name}),j.label&&e.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:j.label}),l&&e.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:h?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),h&&l&&e.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:e.jsx(te,{json:JSON.stringify(c.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},x)})})}function Le({runId:t,status:s,ws:r,breakpointNode:o}){const n=s==="suspended",i=a=>{const c=H.getState().breakpoints[t]??{};r.setBreakpoints(t,Object.keys(c)),a==="step"?r.debugStep(t):a==="continue"?r.debugContinue(t):r.debugStop(t)};return e.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),e.jsx(le,{label:"Step",onClick:()=>i("step"),disabled:!n,color:"var(--info)",active:n}),e.jsx(le,{label:"Continue",onClick:()=>i("continue"),disabled:!n,color:"var(--success)",active:n}),e.jsx(le,{label:"Stop",onClick:()=>i("stop"),disabled:!n,color:"var(--error)",active:n}),e.jsx("span",{className:"text-[10px] ml-auto truncate",style:{color:n?"var(--accent)":"var(--text-muted)"},children:n?o?`Paused at ${o}`:"Paused":s})]})}function le({label:t,onClick:s,disabled:r,color:o,active:n}){return e.jsx("button",{onClick:s,disabled:r,className:"px-2.5 py-0.5 h-5 text-[10px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:n?o:"var(--text-muted)",background:n?`color-mix(in srgb, ${o} 10%, transparent)`:"transparent"},onMouseEnter:i=>{r||(i.currentTarget.style.background=`color-mix(in srgb, ${o} 20%, transparent)`)},onMouseLeave:i=>{i.currentTarget.style.background=n?`color-mix(in srgb, ${o} 10%, transparent)`:"transparent"},children:t})}const Te=p.lazy(()=>He(()=>import("./ChatPanel-DvMLkYmo.js"),__vite__mapDeps([2,1,3,4]))),as=[],is=[],cs=[],ls=[];function ds({run:t,ws:s,isMobile:r}){const o=t.mode==="chat",[n,i]=p.useState(280),[a,c]=p.useState(()=>{const d=localStorage.getItem("chatPanelWidth");return d?parseInt(d,10):380}),[x,u]=p.useState("primary"),[l,h]=p.useState(o?"primary":"traces"),[j,b]=p.useState(0),E=p.useRef(null),k=p.useRef(null),w=p.useRef(!1),R=H(d=>d.traces[t.id]||as),B=H(d=>d.logs[t.id]||is),J=H(d=>d.chatMessages[t.id]||cs),V=H(d=>d.stateEvents[t.id]||ls),N=H(d=>d.breakpoints[t.id]);p.useEffect(()=>{s.setBreakpoints(t.id,N?Object.keys(N):[])},[t.id]);const L=p.useCallback(d=>{s.setBreakpoints(t.id,d)},[t.id,s]),W=p.useCallback(d=>{d.preventDefault(),w.current=!0;const g="touches"in d?d.touches[0].clientY:d.clientY,P=n,m=$=>{if(!w.current)return;const f=E.current;if(!f)return;const _="touches"in $?$.touches[0].clientY:$.clientY,C=f.clientHeight-100,O=Math.max(80,Math.min(C,P+(_-g)));i(O)},S=()=>{w.current=!1,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",S),document.body.style.cursor="",document.body.style.userSelect="",b($=>$+1)};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",m),document.addEventListener("mouseup",S),document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",S)},[n]),D=p.useCallback(d=>{d.preventDefault();const g="touches"in d?d.touches[0].clientX:d.clientX,P=a,m=$=>{const f=k.current;if(!f)return;const _="touches"in $?$.touches[0].clientX:$.clientX,C=f.clientWidth-300,O=Math.max(280,Math.min(C,P+(g-_)));c(O)},S=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",S),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(a)),b($=>$+1)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",m),document.addEventListener("mouseup",S),document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",S)},[a]),G=o?"Chat":"Events",z=o?"var(--accent)":"var(--success)",q=d=>d==="primary"?z:d==="events"?"var(--success)":"var(--accent)",M=H(d=>d.activeInterrupt[t.id]??null),I=t.status==="running"?e.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:o?"Thinking...":"Running..."}):o&&t.status==="suspended"&&M?e.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(r){const d=[{id:"traces",label:"Traces",count:R.length},{id:"primary",label:G},...o?[{id:"events",label:"Events",count:V.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:B.length}];return e.jsxs("div",{className:"flex flex-col h-full",children:[(t.mode==="debug"||t.status==="suspended"&&!M||N&&Object.keys(N).length>0)&&e.jsx(Le,{runId:t.id,status:t.status,ws:s,breakpointNode:t.breakpoint_node}),e.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:e.jsx(ae,{entrypoint:t.entrypoint,traces:R,runId:t.id,breakpointNode:t.breakpoint_node,breakpointNextNodes:t.breakpoint_next_nodes,onBreakpointChange:L,fitViewTrigger:j})}),e.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[d.map(g=>e.jsxs("button",{onClick:()=>h(g.id),className:"px-2 py-0.5 h-5 text-[11px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer",style:{color:l===g.id?q(g.id):"var(--text-muted)",background:l===g.id?`color-mix(in srgb, ${q(g.id)} 10%, transparent)`:"transparent"},children:[g.label,g.count!==void 0&&g.count>0&&e.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:g.count})]},g.id)),I]}),e.jsxs("div",{className:"flex-1 overflow-hidden",children:[l==="traces"&&e.jsx(Ee,{traces:R}),l==="primary"&&(o?e.jsx(p.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:e.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:e.jsx(Te,{messages:J,runId:t.id,runStatus:t.status,ws:s})}):e.jsx(ne,{events:V,runStatus:t.status})),l==="events"&&e.jsx(ne,{events:V,runStatus:t.status}),l==="io"&&e.jsx(Me,{run:t}),l==="logs"&&e.jsx(Ce,{logs:B})]})]})}const y=[{id:"primary",label:G},...o?[{id:"events",label:"Events",count:V.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:B.length}];return e.jsxs("div",{ref:k,className:"flex h-full",children:[e.jsxs("div",{ref:E,className:"flex flex-col flex-1 min-w-0",children:[(t.mode==="debug"||t.status==="suspended"&&!M||N&&Object.keys(N).length>0)&&e.jsx(Le,{runId:t.id,status:t.status,ws:s,breakpointNode:t.breakpoint_node}),e.jsx("div",{className:"shrink-0",style:{height:n},children:e.jsx(ae,{entrypoint:t.entrypoint,traces:R,runId:t.id,breakpointNode:t.breakpoint_node,breakpointNextNodes:t.breakpoint_next_nodes,onBreakpointChange:L,fitViewTrigger:j})}),e.jsx("div",{onMouseDown:W,onTouchStart:W,className:"shrink-0 h-1.5 cursor-row-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:e.jsx("div",{className:"absolute inset-0 -top-1 -bottom-1"})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Ee,{traces:R})})]}),e.jsx("div",{onMouseDown:D,onTouchStart:D,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:e.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),e.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:a,background:"var(--bg-primary)"},children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[y.map(d=>e.jsxs("button",{onClick:()=>u(d.id),className:"px-2 py-0.5 h-5 text-[11px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer",style:{color:x===d.id?q(d.id):"var(--text-muted)",background:x===d.id?`color-mix(in srgb, ${q(d.id)} 10%, transparent)`:"transparent"},onMouseEnter:g=>{x!==d.id&&(g.currentTarget.style.color="var(--text-primary)")},onMouseLeave:g=>{x!==d.id&&(g.currentTarget.style.color="var(--text-muted)")},children:[d.label,d.count!==void 0&&d.count>0&&e.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:d.count})]},d.id)),I]}),e.jsxs("div",{className:"flex-1 overflow-hidden",children:[x==="primary"&&(o?e.jsx(p.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:e.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:e.jsx(Te,{messages:J,runId:t.id,runStatus:t.status,ws:s})}):e.jsx(ne,{events:V,runStatus:t.status})),x==="events"&&e.jsx(ne,{events:V,runStatus:t.status}),x==="io"&&e.jsx(Me,{run:t}),x==="logs"&&e.jsx(Ce,{logs:B})]})]})]})}function Me({run:t}){return e.jsxs("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[e.jsx(Re,{title:"Input",color:"var(--success)",copyText:JSON.stringify(t.input_data,null,2),children:e.jsx(te,{json:JSON.stringify(t.input_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),t.output_data&&e.jsx(Re,{title:"Output",color:"var(--accent)",copyText:typeof t.output_data=="string"?t.output_data:JSON.stringify(t.output_data,null,2),children:e.jsx(te,{json:typeof t.output_data=="string"?t.output_data:JSON.stringify(t.output_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),t.error&&e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[e.jsxs("div",{className:"px-4 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[e.jsx("span",{children:"Error"}),e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:t.error.code}),e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:t.error.category})]}),e.jsxs("div",{className:"p-4 text-xs leading-normal",style:{background:"var(--bg-secondary)"},children:[e.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:t.error.title}),e.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:t.error.detail})]})]})]})}function Re({title:t,color:s,copyText:r,children:o}){const[n,i]=p.useState(!1),a=p.useCallback(()=>{r&&navigator.clipboard.writeText(r).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[r]);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-1 h-4 rounded-full",style:{background:s}}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:s},children:t}),r&&e.jsx("button",{onClick:a,className:"ml-auto text-[10px] cursor-pointer px-1.5 py-0.5 rounded",style:{color:n?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:n?"Copied":"Copy"})]}),o]})}function us(){const{reloadPending:t,setReloadPending:s,setEntrypoints:r}=H(),[o,n]=p.useState(!1);if(!t)return null;const i=async()=>{n(!0);try{await dt();const a=await Ie();r(a.map(c=>c.name)),s(!1)}catch(a){console.error("Reload failed:",a)}finally{n(!1)}};return e.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[e.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed — reload to apply"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:i,disabled:o,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:o?.6:1},children:o?"Reloading...":"Reload"}),e.jsx("button",{onClick:()=>s(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}function ps(){const t=nt(),s=xt(),[r,o]=p.useState(!1),{runs:n,selectedRunId:i,setRuns:a,upsertRun:c,selectRun:x,setTraces:u,setLogs:l,setChatMessages:h,setEntrypoints:j,setStateEvents:b,setGraphCache:E,setActiveNode:k,removeActiveNode:w}=H(),{view:R,runId:B,setupEntrypoint:J,setupMode:V,navigate:N}=Pe();p.useEffect(()=>{R==="details"&&B&&B!==i&&x(B)},[R,B,i,x]),p.useEffect(()=>{lt().then(a).catch(console.error),Ie().then(M=>j(M.map(I=>I.name))).catch(console.error)},[a,j]);const L=i?n[i]:null,W=p.useCallback((M,I)=>{c(I),u(M,I.traces),l(M,I.logs);const y=I.messages.map(d=>{const g=d.contentParts??d.content_parts??[],P=d.toolCalls??d.tool_calls??[];return{message_id:d.messageId??d.message_id,role:d.role??"assistant",content:g.filter(m=>{const S=m.mimeType??m.mime_type??"";return S.startsWith("text/")||S==="application/json"}).map(m=>{const S=m.data;return(S==null?void 0:S.inline)??""}).join(`
-`).trim()??"",tool_calls:P.length>0?P.map(m=>({name:m.name??"",has_result:!!m.result})):void 0}});if(h(M,y),I.graph&&I.graph.nodes.length>0&&E(M,I.graph),I.states&&I.states.length>0&&(b(M,I.states.map(d=>({node_name:d.node_name,qualified_node_name:d.qualified_node_name,phase:d.phase,timestamp:new Date(d.timestamp).getTime(),payload:d.payload}))),I.status!=="completed"&&I.status!=="failed"))for(const d of I.states)d.phase==="started"?k(M,d.node_name,d.qualified_node_name):d.phase==="completed"&&w(M,d.node_name)},[c,u,l,h,b,E,k,w]);p.useEffect(()=>{if(!i)return;t.subscribe(i),ie(i).then(I=>W(i,I)).catch(console.error);const M=setTimeout(()=>{const I=H.getState().runs[i];I&&(I.status==="pending"||I.status==="running")&&ie(i).then(y=>W(i,y)).catch(console.error)},2e3);return()=>{clearTimeout(M),t.unsubscribe(i)}},[i,t,W]);const D=p.useRef(null);p.useEffect(()=>{var y,d;if(!i)return;const M=L==null?void 0:L.status,I=D.current;if(D.current=M??null,M&&(M==="completed"||M==="failed")&&I!==M){const g=H.getState(),P=((y=g.traces[i])==null?void 0:y.length)??0,m=((d=g.logs[i])==null?void 0:d.length)??0,S=(L==null?void 0:L.trace_count)??0,$=(L==null?void 0:L.log_count)??0;(PW(i,f)).catch(console.error)}},[i,L==null?void 0:L.status,W]);const G=M=>{N(`#/runs/${M}/traces`),x(M),o(!1)},z=M=>{N(`#/runs/${M}/traces`),x(M),o(!1)},q=()=>{N("#/new"),o(!1)};return e.jsxs("div",{className:"flex h-screen w-screen relative",children:[s&&!r&&e.jsx("button",{onClick:()=>o(!0),className:"fixed top-2 left-2 z-40 w-9 h-9 flex items-center justify-center rounded-lg cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),e.jsx(ft,{runs:Object.values(n),selectedRunId:i,onSelectRun:z,onNewRun:q,isMobile:s,isOpen:r,onClose:()=>o(!1)}),e.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:R==="new"?e.jsx(vt,{}):R==="setup"&&J&&V?e.jsx(Vt,{entrypoint:J,mode:V,ws:t,onRunCreated:G,isMobile:s}):L?e.jsx(ds,{run:L,ws:t,isMobile:s}):e.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"})}),e.jsx(us,{})]})}Fe.createRoot(document.getElementById("root")).render(e.jsx(p.StrictMode,{children:e.jsx(ps,{})}));export{H as u};
diff --git a/src/uipath/dev/server/static/assets/index-BZ-OsryT.js b/src/uipath/dev/server/static/assets/index-BZ-OsryT.js
new file mode 100644
index 0000000..c923603
--- /dev/null
+++ b/src/uipath/dev/server/static/assets/index-BZ-OsryT.js
@@ -0,0 +1,42 @@
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CTNP4r_q.js","assets/vendor-react-BVoutfaX.js","assets/ChatPanel-0HELh5u1.js","assets/vendor-reactflow-mU21rT8r.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]);
+var Ge=Object.defineProperty;var qe=(t,r,s)=>r in t?Ge(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var K=(t,r,s)=>qe(t,typeof r!="symbol"?r+"":r,s);import{R as se,a as h,j as e,b as Ye}from"./vendor-react-BVoutfaX.js";import{H as Y,P as X,B as Xe,M as Ke,u as Ze,a as Qe,R as et,b as tt,C as rt,c as st,d as ot}from"./vendor-reactflow-mU21rT8r.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function s(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(n){if(n.ep)return;n.ep=!0;const i=s(n);fetch(n.href,i)}})();const xe=t=>{let r;const s=new Set,o=(d,l)=>{const p=typeof d=="function"?d(r):d;if(!Object.is(p,r)){const j=r;r=l??(typeof p!="object"||p===null)?p:Object.assign({},r,p),s.forEach(y=>y(r,j))}},n=()=>r,c={setState:o,getState:n,getInitialState:()=>m,subscribe:d=>(s.add(d),()=>s.delete(d))},m=r=t(o,n,c);return c},nt=(t=>t?xe(t):xe),at=t=>t;function it(t,r=at){const s=se.useSyncExternalStore(t.subscribe,se.useCallback(()=>r(t.getState()),[t,r]),se.useCallback(()=>r(t.getInitialState()),[t,r]));return se.useDebugValue(s),s}const me=t=>{const r=nt(t),s=o=>it(r,o);return Object.assign(s,r),s},he=(t=>t?me(t):me),O=he(t=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:r=>t(s=>{var i;let o=s.breakpoints;for(const a of r)(i=a.breakpoints)!=null&&i.length&&!o[a.id]&&(o={...o,[a.id]:Object.fromEntries(a.breakpoints.map(c=>[c,!0]))});const n={runs:Object.fromEntries(r.map(a=>[a.id,a]))};return o!==s.breakpoints&&(n.breakpoints=o),n}),upsertRun:r=>t(s=>{var n;const o={runs:{...s.runs,[r.id]:r}};if((n=r.breakpoints)!=null&&n.length&&!s.breakpoints[r.id]&&(o.breakpoints={...s.breakpoints,[r.id]:Object.fromEntries(r.breakpoints.map(i=>[i,!0]))}),(r.status==="completed"||r.status==="failed")&&s.activeNodes[r.id]){const{[r.id]:i,...a}=s.activeNodes;o.activeNodes=a}if(r.status!=="suspended"&&s.activeInterrupt[r.id]){const{[r.id]:i,...a}=s.activeInterrupt;o.activeInterrupt=a}return o}),selectRun:r=>t({selectedRunId:r}),addTrace:r=>t(s=>{const o=s.traces[r.run_id]??[],n=o.findIndex(a=>a.span_id===r.span_id),i=n>=0?o.map((a,c)=>c===n?r:a):[...o,r];return{traces:{...s.traces,[r.run_id]:i}}}),setTraces:(r,s)=>t(o=>({traces:{...o.traces,[r]:s}})),addLog:r=>t(s=>{const o=s.logs[r.run_id]??[];return{logs:{...s.logs,[r.run_id]:[...o,r]}}}),setLogs:(r,s)=>t(o=>({logs:{...o.logs,[r]:s}})),addChatEvent:(r,s)=>t(o=>{const n=o.chatMessages[r]??[],i=s.message;if(!i)return o;const a=i.messageId??i.message_id,c=i.role??"assistant",l=(i.contentParts??i.content_parts??[]).filter(k=>{const w=k.mimeType??k.mime_type??"";return w.startsWith("text/")||w==="application/json"}).map(k=>{const w=k.data;return(w==null?void 0:w.inline)??""}).join(`
+`).trim(),p=(i.toolCalls??i.tool_calls??[]).map(k=>({name:k.name??"",has_result:!!k.result})),j={message_id:a,role:c,content:l,tool_calls:p.length>0?p:void 0},y=n.findIndex(k=>k.message_id===a);if(y>=0)return{chatMessages:{...o.chatMessages,[r]:n.map((k,w)=>w===y?j:k)}};if(c==="user"){const k=n.findIndex(w=>w.message_id.startsWith("local-")&&w.role==="user"&&w.content===l);if(k>=0)return{chatMessages:{...o.chatMessages,[r]:n.map((w,$)=>$===k?j:w)}}}const C=[...n,j];return{chatMessages:{...o.chatMessages,[r]:C}}}),addLocalChatMessage:(r,s)=>t(o=>{const n=o.chatMessages[r]??[];return{chatMessages:{...o.chatMessages,[r]:[...n,s]}}}),setChatMessages:(r,s)=>t(o=>({chatMessages:{...o.chatMessages,[r]:s}})),setEntrypoints:r=>t({entrypoints:r}),breakpoints:{},toggleBreakpoint:(r,s)=>t(o=>{const n={...o.breakpoints[r]??{}};return n[s]?delete n[s]:n[s]=!0,{breakpoints:{...o.breakpoints,[r]:n}}}),clearBreakpoints:r=>t(s=>{const{[r]:o,...n}=s.breakpoints;return{breakpoints:n}}),activeNodes:{},setActiveNode:(r,s,o)=>t(n=>{const i=n.activeNodes[r]??{executing:{},prev:null};return{activeNodes:{...n.activeNodes,[r]:{executing:{...i.executing,[s]:o??null},prev:i.prev}}}}),removeActiveNode:(r,s)=>t(o=>{const n=o.activeNodes[r];if(!n)return o;const{[s]:i,...a}=n.executing;return{activeNodes:{...o.activeNodes,[r]:{executing:a,prev:s}}}}),resetRunGraphState:r=>t(s=>({stateEvents:{...s.stateEvents,[r]:[]},activeNodes:{...s.activeNodes,[r]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(r,s,o,n,i)=>t(a=>{const c=a.stateEvents[r]??[];return{stateEvents:{...a.stateEvents,[r]:[...c,{node_name:s,qualified_node_name:n,phase:i,timestamp:Date.now(),payload:o}]}}}),setStateEvents:(r,s)=>t(o=>({stateEvents:{...o.stateEvents,[r]:s}})),focusedSpan:null,setFocusedSpan:r=>t({focusedSpan:r}),activeInterrupt:{},setActiveInterrupt:(r,s)=>t(o=>({activeInterrupt:{...o.activeInterrupt,[r]:s}})),reloadPending:!1,setReloadPending:r=>t({reloadPending:r}),graphCache:{},setGraphCache:(r,s)=>t(o=>({graphCache:{...o.graphCache,[r]:s}}))})),ie="/api";async function ct(t){const r=await fetch(`${ie}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({environment:t})});if(!r.ok)throw new Error(`Login failed: ${r.status}`);return r.json()}async function ce(){const t=await fetch(`${ie}/auth/status`);if(!t.ok)throw new Error(`Status check failed: ${t.status}`);return t.json()}async function lt(t){const r=await fetch(`${ie}/auth/select-tenant`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_name:t})});if(!r.ok)throw new Error(`Tenant selection failed: ${r.status}`);return r.json()}async function dt(){await fetch(`${ie}/auth/logout`,{method:"POST"})}const We="uipath-env",ut=["cloud","staging","alpha"];function pt(){const t=localStorage.getItem(We);return ut.includes(t)?t:"cloud"}const Ae=he((t,r)=>({enabled:!0,status:"unauthenticated",environment:pt(),tenants:[],uipathUrl:null,pollTimer:null,expiryTimer:null,init:async()=>{try{const s=await fetch("/api/config");if(s.ok&&!(await s.json()).auth_enabled){t({enabled:!1});return}const o=await ce();t({status:o.status,tenants:o.tenants??[],uipathUrl:o.uipath_url??null}),o.status==="authenticated"&&r().startExpiryCheck()}catch(s){console.error("Auth init failed",s)}},setEnvironment:s=>{localStorage.setItem(We,s),t({environment:s})},startLogin:async()=>{const{environment:s}=r();try{const o=await ct(s);t({status:"pending"}),window.open(o.auth_url,"_blank"),r().pollStatus()}catch(o){console.error("Login failed",o)}},pollStatus:()=>{const{pollTimer:s}=r();if(s)return;const o=setInterval(async()=>{try{const n=await ce();n.status!=="pending"&&(r().stopPolling(),t({status:n.status,tenants:n.tenants??[],uipathUrl:n.uipath_url??null}),n.status==="authenticated"&&r().startExpiryCheck())}catch{}},2e3);t({pollTimer:o})},stopPolling:()=>{const{pollTimer:s}=r();s&&(clearInterval(s),t({pollTimer:null}))},startExpiryCheck:()=>{const{expiryTimer:s}=r();if(s)return;const o=setInterval(async()=>{try{(await ce()).status==="expired"&&(r().stopExpiryCheck(),t({status:"expired"}))}catch{}},3e4);t({expiryTimer:o})},stopExpiryCheck:()=>{const{expiryTimer:s}=r();s&&(clearInterval(s),t({expiryTimer:null}))},selectTenant:async s=>{try{const o=await lt(s);t({status:"authenticated",uipathUrl:o.uipath_url,tenants:[]}),r().startExpiryCheck()}catch(o){console.error("Tenant selection failed",o)}},logout:async()=>{r().stopPolling(),r().stopExpiryCheck();try{await dt()}catch{}t({status:"unauthenticated",tenants:[],uipathUrl:null})}}));class ht{constructor(r){K(this,"ws",null);K(this,"url");K(this,"handlers",new Set);K(this,"reconnectTimer",null);K(this,"shouldReconnect",!0);K(this,"pendingMessages",[]);K(this,"activeSubscriptions",new Set);const s=window.location.protocol==="https:"?"wss:":"ws:";this.url=r??`${s}//${window.location.host}/ws`}connect(){var r;((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const s of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:s}}));for(const s of this.pendingMessages)this.sendRaw(s);this.pendingMessages=[]},this.ws.onmessage=s=>{let o;try{o=JSON.parse(s.data)}catch{console.warn("[ws] failed to parse message",s.data);return}this.handlers.forEach(n=>{try{n(o)}catch(i){console.error("[ws] handler error",i)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var s;(s=this.ws)==null||s.close()})}disconnect(){var r;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.ws)==null||r.close(),this.ws=null}onMessage(r){return this.handlers.add(r),()=>this.handlers.delete(r)}sendRaw(r){var s;((s=this.ws)==null?void 0:s.readyState)===WebSocket.OPEN&&this.ws.send(r)}send(r,s){var n;const o=JSON.stringify({type:r,payload:s});((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?this.ws.send(o):this.pendingMessages.push(o)}subscribe(r){this.activeSubscriptions.add(r),this.send("subscribe",{run_id:r})}unsubscribe(r){this.activeSubscriptions.delete(r),this.send("unsubscribe",{run_id:r})}sendChatMessage(r,s){this.send("chat.message",{run_id:r,text:s})}sendInterruptResponse(r,s){this.send("chat.interrupt_response",{run_id:r,data:s})}debugStep(r){this.send("debug.step",{run_id:r})}debugContinue(r){this.send("debug.continue",{run_id:r})}debugStop(r){this.send("debug.stop",{run_id:r})}setBreakpoints(r,s){this.send("debug.set_breakpoints",{run_id:r,breakpoints:s})}}let oe=null;function xt(){return oe||(oe=new ht,oe.connect()),oe}function mt(){const t=h.useRef(xt()),{upsertRun:r,addTrace:s,addLog:o,addChatEvent:n,setActiveInterrupt:i,setActiveNode:a,removeActiveNode:c,resetRunGraphState:m,addStateEvent:d,setReloadPending:l}=O();return h.useEffect(()=>t.current.onMessage(y=>{switch(y.type){case"run.updated":r(y.payload);break;case"trace":s(y.payload);break;case"log":o(y.payload);break;case"chat":{const C=y.payload.run_id;n(C,y.payload);break}case"chat.interrupt":{const C=y.payload.run_id;i(C,y.payload);break}case"state":{const C=y.payload.run_id,k=y.payload.node_name,w=y.payload.qualified_node_name??null,$=y.payload.phase??null,B=y.payload.payload;k==="__start__"&&$==="started"&&m(C),$==="started"?a(C,k,w):$==="completed"&&c(C,k),d(C,k,B,w,$);break}case"reload":l(!0);break}}),[r,s,o,n,i,a,c,m,d,l]),t.current}const Z="/api";async function Q(t,r){const s=await fetch(t,r);if(!s.ok){let o;try{o=(await s.json()).detail||s.statusText}catch{o=s.statusText}const n=new Error(`HTTP ${s.status}`);throw n.detail=o,n.status=s.status,n}return s.json()}async function He(){return Q(`${Z}/entrypoints`)}async function gt(t){return Q(`${Z}/entrypoints/${encodeURIComponent(t)}/schema`)}async function ft(t){return Q(`${Z}/entrypoints/${encodeURIComponent(t)}/mock-input`)}async function vt(t){return Q(`${Z}/entrypoints/${encodeURIComponent(t)}/graph`)}async function ge(t,r,s="run",o=[]){return Q(`${Z}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:t,input_data:r,mode:s,breakpoints:o})})}async function yt(){return Q(`${Z}/runs`)}async function le(t){return Q(`${Z}/runs/${t}`)}async function bt(){return Q(`${Z}/reload`,{method:"POST"})}function jt(t){const r=t.replace(/^#\/?/,"");if(!r||r==="new")return{view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null};const s=r.match(/^setup\/([^/]+)\/(run|chat)$/);if(s)return{view:"setup",runId:null,tab:"traces",setupEntrypoint:decodeURIComponent(s[1]),setupMode:s[2]};const o=r.match(/^runs\/([^/]+)(?:\/(traces|output))?$/);return o?{view:"details",runId:o[1],tab:o[2]??"traces",setupEntrypoint:null,setupMode:null}:{view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null}}function wt(){return window.location.hash}function kt(t){return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)}function Be(){const t=h.useSyncExternalStore(kt,wt),r=jt(t),s=h.useCallback(o=>{window.location.hash=o},[]);return{...r,navigate:s}}const fe="(max-width: 767px)";function Nt(){const[t,r]=h.useState(()=>window.matchMedia(fe).matches);return h.useEffect(()=>{const s=window.matchMedia(fe),o=n=>r(n.matches);return s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[]),t}function De(){const t=localStorage.getItem("uipath-dev-theme");return t==="light"||t==="dark"?t:"dark"}function ze(t){document.documentElement.setAttribute("data-theme",t),localStorage.setItem("uipath-dev-theme",t)}ze(De());const St=he(t=>({theme:De(),toggleTheme:()=>t(r=>{const s=r.theme==="dark"?"light":"dark";return ze(s),{theme:s}})})),Et={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function ve({run:t,isSelected:r,onClick:s}){var a;const o=Et[t.status]??"var(--text-muted)",n=((a=t.entrypoint.split("/").pop())==null?void 0:a.slice(0,16))??t.entrypoint,i=t.start_time?new Date(t.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"";return e.jsxs("button",{onClick:s,className:"w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:r?"color-mix(in srgb, var(--accent) 8%, var(--bg-primary))":void 0,borderLeft:r?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:c=>{r||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{r||(c.currentTarget.style.background="")},children:[e.jsx("span",{className:"shrink-0 w-1.5 h-1.5 rounded-full",style:{background:o}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs truncate",style:{color:r?"var(--text-primary)":"var(--text-secondary)"},children:n}),e.jsxs("div",{className:"text-[10px] tabular-nums",style:{color:"var(--text-muted)"},children:[i,t.duration?` · ${t.duration}`:""]})]})]})}function Ct({runs:t,selectedRunId:r,onSelectRun:s,onNewRun:o,isMobile:n,isOpen:i,onClose:a}){const{theme:c,toggleTheme:m}=St(),d=[...t].sort((l,p)=>new Date(p.start_time??0).getTime()-new Date(l.start_time??0).getTime());return n?i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:a}),e.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[e.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[e.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 cursor-pointer transition-opacity hover:opacity-80",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("rect",{width:"24",height:"24",rx:"4",fill:"var(--accent)"}),e.jsx("text",{x:"12",y:"17",textAnchor:"middle",fill:"white",fontSize:"14",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"U"})]}),e.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Dev Console"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:m,className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},title:`Switch to ${c==="dark"?"light":"dark"} theme`,children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c==="dark"?e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"5"}),e.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),e.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),e.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),e.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),e.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),e.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),e.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),e.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):e.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),e.jsx("button",{onClick:a,className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsx("button",{onClick:o,className:"mx-3 mt-2.5 mb-1 px-2 py-1.5 text-[10px] uppercase tracking-wider font-semibold rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-muted)"},children:"+ New Run"}),e.jsx("div",{className:"px-3 pt-3 pb-1 text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.map(l=>e.jsx(ve,{run:l,isSelected:l.id===r,onClick:()=>s(l.id)},l.id)),d.length===0&&e.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]}),e.jsx(ye,{})]})]}):null:e.jsxs("aside",{className:"w-44 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[e.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[e.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 cursor-pointer transition-opacity hover:opacity-80",children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("rect",{width:"24",height:"24",rx:"4",fill:"var(--accent)"}),e.jsx("text",{x:"12",y:"17",textAnchor:"middle",fill:"white",fontSize:"14",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"U"})]}),e.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Dev Console"})]}),e.jsx("button",{onClick:m,className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-muted)"},title:`Switch to ${c==="dark"?"light":"dark"} theme`,children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c==="dark"?e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"5"}),e.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),e.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),e.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),e.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),e.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),e.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),e.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),e.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):e.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})})]}),e.jsx("button",{onClick:o,className:"mx-3 mt-2.5 mb-1 px-2 py-1 text-[10px] uppercase tracking-wider font-semibold rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-muted)",l.currentTarget.style.borderColor="var(--border)"},children:"+ New Run"}),e.jsx("div",{className:"px-3 pt-3 pb-1 text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.map(l=>e.jsx(ve,{run:l,isSelected:l.id===r,onClick:()=>s(l.id)},l.id)),d.length===0&&e.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]}),e.jsx(ye,{})]})}function ye(){const{enabled:t,status:r,environment:s,tenants:o,uipathUrl:n,setEnvironment:i,startLogin:a,selectTenant:c,logout:m}=Ae(),[d,l]=h.useState("");if(!t)return null;if(r==="authenticated"||r==="expired"){const p=n?n.replace(/^https?:\/\/[^/]+\//,""):"",j=r==="expired";return e.jsx("div",{className:"px-2 py-2 border-t border-[var(--border)]",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[j?e.jsxs("button",{onClick:a,className:"flex items-center gap-1.5 min-w-0 cursor-pointer transition-opacity hover:opacity-80",style:{background:"none",border:"none",padding:0},title:"Token expired — click to re-authenticate",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--error)"}}),e.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-muted)"},children:p})]}):e.jsxs("a",{href:n??"#",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 min-w-0 transition-opacity hover:opacity-80",title:n??"",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--success)"}}),e.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-muted)"},children:p})]}),e.jsx("button",{onClick:m,className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:y=>{y.currentTarget.style.color="var(--text-primary)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text-muted)"},title:"Sign out",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),e.jsx("polyline",{points:"16 17 21 12 16 7"}),e.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})})}return r==="pending"?e.jsxs("div",{className:"px-2 py-2 border-t border-[var(--border)] flex items-center gap-2",children:[e.jsxs("svg",{className:"animate-spin",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]}),e.jsx("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:"Signing in…"})]}):r==="needs_tenant"?e.jsxs("div",{className:"px-2 py-2 border-t border-[var(--border)]",children:[e.jsx("label",{className:"block text-[10px] uppercase tracking-wider font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Tenant"}),e.jsxs("select",{value:d,onChange:p=>l(p.target.value),className:"w-full rounded px-1.5 py-1 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[e.jsx("option",{value:"",children:"Select…"}),o.map(p=>e.jsx("option",{value:p,children:p},p))]}),e.jsx("button",{onClick:()=>d&&c(d),disabled:!d,className:"w-full px-2 py-1 text-[10px] uppercase tracking-wider font-semibold rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--text-muted)"},children:"Confirm"})]}):e.jsxs("div",{className:"px-2 py-2 border-t border-[var(--border)]",children:[e.jsxs("select",{value:s,onChange:p=>i(p.target.value),className:"w-full rounded px-1.5 py-0.5 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:[e.jsx("option",{value:"cloud",children:"cloud"}),e.jsx("option",{value:"staging",children:"staging"}),e.jsx("option",{value:"alpha",children:"alpha"})]}),e.jsx("button",{onClick:a,className:"w-full px-2 py-1 text-[10px] uppercase tracking-wider font-semibold rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:p=>{p.currentTarget.style.color="var(--text-primary)",p.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--text-muted)",p.currentTarget.style.borderColor="var(--border)"},children:"Sign In"})]})}function _t(){const{navigate:t}=Be(),r=O(d=>d.entrypoints),[s,o]=h.useState(""),[n,i]=h.useState(!0),[a,c]=h.useState(null);h.useEffect(()=>{!s&&r.length>0&&o(r[0])},[r,s]),h.useEffect(()=>{s&&(i(!0),c(null),gt(s).then(d=>{var p;const l=(p=d.input)==null?void 0:p.properties;i(!!(l!=null&&l.messages))}).catch(d=>{const l=d.detail||{};c(l.error||l.message||`Failed to load entrypoint "${s}"`)}))},[s]);const m=d=>{s&&t(`#/setup/${encodeURIComponent(s)}/${d}`)};return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"w-full max-w-xl px-6",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:a?"var(--error)":"var(--accent)"}}),e.jsx("span",{className:"text-xs uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!a&&e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:r.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),r.length>1&&e.jsxs("div",{className:"mb-8",children:[e.jsx("label",{className:"block text-[10px] uppercase tracking-wider font-semibold mb-2",style:{color:"var(--text-muted)"},children:"Entrypoint"}),e.jsx("select",{id:"entrypoint-select",value:s,onChange:d=>o(d.target.value),className:"w-full rounded-md px-3 py-1.5 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:r.map(d=>e.jsx("option",{value:d,children:d},d))})]}),a?e.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),e.jsx("div",{className:"overflow-auto max-h-48 p-3",children:e.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:a})})]}):e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(be,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:e.jsx(Lt,{}),color:"var(--success)",onClick:()=>m("run"),disabled:!s}),e.jsx(be,{title:"Conversational",description:n?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:e.jsx(Tt,{}),color:"var(--accent)",onClick:()=>m("chat"),disabled:!s||!n})]}),e.jsx("div",{className:"mt-8 text-center",children:e.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[12px] uppercase tracking-widest font-semibold transition-opacity hover:opacity-80",style:{color:"var(--text-muted)"},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),"GitHub"]})})]})})}function be({title:t,description:r,icon:s,color:o,onClick:n,disabled:i}){return e.jsxs("button",{onClick:n,disabled:i,className:"group flex flex-col items-center text-center p-6 rounded-lg border transition-all cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:a=>{i||(a.currentTarget.style.borderColor=o,a.currentTarget.style.background=`color-mix(in srgb, ${o} 5%, var(--bg-secondary))`)},onMouseLeave:a=>{a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--bg-secondary)"},children:[e.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${o} 10%, var(--bg-primary))`,color:o},children:s}),e.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:t}),e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:r})]})}function Lt(){return e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function Tt(){return e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),e.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),e.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),e.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),e.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),e.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),e.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),e.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const Mt="modulepreload",$t=function(t){return"/"+t},je={},Ve=function(r,s,o){let n=Promise.resolve();if(s&&s.length>0){let a=function(d){return Promise.all(d.map(l=>Promise.resolve(l).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),m=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=a(s.map(d=>{if(d=$t(d),d in je)return;je[d]=!0;const l=d.endsWith(".css"),p=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const j=document.createElement("link");if(j.rel=l?"stylesheet":Mt,l||(j.as="script"),j.crossOrigin="",j.href=d,m&&j.setAttribute("nonce",m),document.head.appendChild(j),l)return new Promise((y,C)=>{j.addEventListener("load",y),j.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return n.then(a=>{for(const c of a||[])c.status==="rejected"&&i(c.reason);return r().catch(i)})},Rt={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function It({data:t}){const r=t.status,s=t.nodeWidth,o=t.label??"Start",n=t.hasBreakpoint,i=t.isPausedHere,a=t.isActiveNode,c=t.isExecutingNode,m=i?"var(--error)":c?"var(--success)":a?"var(--accent)":r==="completed"?"var(--success)":r==="running"?"var(--warning)":"var(--node-border)",d=i?"var(--error)":c?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:s,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${m}`,boxShadow:i||a||c?`0 0 4px ${d}`:void 0,animation:i||a||c?`node-pulse-${i?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o,children:[n&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),o,e.jsx(Y,{type:"source",position:X.Bottom,style:Rt})]})}const Pt={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Ot({data:t}){const r=t.status,s=t.nodeWidth,o=t.label??"End",n=t.hasBreakpoint,i=t.isPausedHere,a=t.isActiveNode,c=t.isExecutingNode,m=i?"var(--error)":c?"var(--success)":a?"var(--accent)":r==="completed"?"var(--success)":r==="failed"?"var(--error)":"var(--node-border)",d=i?"var(--error)":c?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:s,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${m}`,boxShadow:i||a||c?`0 0 4px ${d}`:void 0,animation:i||a||c?`node-pulse-${i?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o,children:[n&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top,style:Pt}),o]})}const we={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Wt({data:t}){const r=t.status,s=t.nodeWidth,o=t.model_name,n=t.label??"Model",i=t.hasBreakpoint,a=t.isPausedHere,c=t.isActiveNode,m=t.isExecutingNode,d=a?"var(--error)":m?"var(--success)":c?"var(--accent)":r==="completed"?"var(--success)":r==="running"?"var(--warning)":r==="failed"?"var(--error)":"var(--node-border)",l=a?"var(--error)":m?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:s,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${d}`,boxShadow:a||c||m?`0 0 4px ${l}`:void 0,animation:a||c||m?`node-pulse-${a?"red":m?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o?`${n}
+${o}`:n,children:[i&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top,style:we}),e.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n}),o&&e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:o,children:o}),e.jsx(Y,{type:"source",position:X.Bottom,style:we})]})}const ke={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},At=3;function Ht({data:t}){const r=t.status,s=t.nodeWidth,o=t.tool_names,n=t.tool_count,i=t.label??"Tool",a=t.hasBreakpoint,c=t.isPausedHere,m=t.isActiveNode,d=t.isExecutingNode,l=c?"var(--error)":d?"var(--success)":m?"var(--accent)":r==="completed"?"var(--success)":r==="running"?"var(--warning)":r==="failed"?"var(--error)":"var(--node-border)",p=c?"var(--error)":d?"var(--success)":"var(--accent)",j=(o==null?void 0:o.slice(0,At))??[],y=(n??(o==null?void 0:o.length)??0)-j.length;return e.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:s,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${l}`,boxShadow:c||m||d?`0 0 4px ${p}`:void 0,animation:c||m||d?`node-pulse-${c?"red":d?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o!=null&&o.length?`${i}
+
+${o.join(`
+`)}`:i,children:[a&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top,style:ke}),e.jsxs("div",{style:{color:"var(--warning)",fontSize:9,marginBottom:1},children:["tools",n?` (${n})`:""]}),e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:i}),j.length>0&&e.jsxs("div",{style:{marginTop:3,fontSize:9,color:"var(--text-muted)",textAlign:"left"},children:[j.map(C=>e.jsx("div",{className:"truncate",children:C},C)),y>0&&e.jsxs("div",{style:{fontStyle:"italic"},children:["+",y," more"]})]}),e.jsx(Y,{type:"source",position:X.Bottom,style:ke})]})}const Ne={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Bt({data:t}){const r=t.label??"",s=t.status,o=t.hasBreakpoint,n=t.isPausedHere,i=t.isActiveNode,a=t.isExecutingNode,c=n?"var(--error)":a?"var(--success)":i?"var(--accent)":s==="completed"?"var(--success)":s==="running"?"var(--warning)":s==="failed"?"var(--error)":"var(--bg-tertiary)",m=n?"var(--error)":a?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"relative cursor-pointer",style:{width:"100%",height:"100%",background:"var(--bg-secondary)",border:`1.5px ${n||i||a?"solid":"dashed"} ${c}`,borderRadius:8,boxShadow:n||i||a?`0 0 4px ${m}`:void 0,animation:n||i||a?`node-pulse-${n?"red":a?"green":"accent"} 1.5s ease-in-out infinite`:void 0},children:[o&&e.jsx("div",{className:"absolute",style:{top:4,left:4,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--bg-tertiary)",boxShadow:"0 0 4px var(--error)",zIndex:1}}),e.jsx(Y,{type:"target",position:X.Top,style:Ne}),e.jsx("div",{style:{padding:"4px 10px",fontSize:10,color:"var(--text-muted)",fontWeight:600,textAlign:"center",borderBottom:`1px solid ${c}`,background:"var(--bg-tertiary)",borderRadius:"8px 8px 0 0"},children:r}),e.jsx(Y,{type:"source",position:X.Bottom,style:Ne})]})}function Dt({data:t}){const r=t.status,s=t.nodeWidth,o=t.label??"",n=t.hasBreakpoint,i=t.isPausedHere,a=t.isActiveNode,c=t.isExecutingNode,m=i?"var(--error)":c?"var(--success)":a?"var(--accent)":r==="completed"?"var(--success)":r==="running"?"var(--warning)":r==="failed"?"var(--error)":"var(--node-border)",d=i?"var(--error)":c?"var(--success)":"var(--accent)";return e.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:s,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${m}`,boxShadow:i||a||c?`0 0 4px ${d}`:void 0,animation:i||a||c?`node-pulse-${i?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:o,children:[n&&e.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),e.jsx(Y,{type:"target",position:X.Top}),e.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:o}),e.jsx(Y,{type:"source",position:X.Bottom})]})}function zt(t,r=8){if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let n=1;n0&&(s+=Math.min(o.length,3)*12+(o.length>3?12:0)+4),t!=null&&t.model_name&&(s+=14),s}let de=null;async function Yt(){if(!de){const{default:t}=await Ve(async()=>{const{default:r}=await import("./vendor-elk-CTNP4r_q.js").then(s=>s.e);return{default:r}},__vite__mapDeps([0,1]));de=new t}return de}const Ce={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.spacing.nodeNode":"25","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.spacing.edgeNode":"30","elk.spacing.edgeEdge":"15","elk.layered.spacing.edgeNodeBetweenLayers":"25","elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.portAlignment.default":"CENTER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},Xt="[top=35,left=15,bottom=15,right=15]";function Kt(t){const r=[],s=[];for(const o of t.nodes){const n=o.data,i={id:o.id,width:Se(n),height:Ee(n,o.type)};if(o.data.subgraph){const a=o.data.subgraph;delete i.width,delete i.height,i.layoutOptions={...Ce,"elk.padding":Xt},i.children=a.nodes.map(c=>({id:`${o.id}/${c.id}`,width:Se(c.data),height:Ee(c.data,c.type)})),i.edges=a.edges.map(c=>({id:`${o.id}/${c.id}`,sources:[`${o.id}/${c.source}`],targets:[`${o.id}/${c.target}`]}))}r.push(i)}for(const o of t.edges)s.push({id:o.id,sources:[o.source],targets:[o.target]});return{id:"root",layoutOptions:Ce,children:r,edges:s}}const pe={type:Ke.ArrowClosed,width:12,height:12,color:"var(--node-border)"};function Fe(t){return{stroke:"var(--node-border)",strokeWidth:1.5,...t?{strokeDasharray:"6 3"}:{}}}function _e(t,r,s,o,n){var d;const i=(d=t.sections)==null?void 0:d[0],a=(n==null?void 0:n.x)??0,c=(n==null?void 0:n.y)??0;let m;if(i)m={sourcePoint:{x:i.startPoint.x+a,y:i.startPoint.y+c},targetPoint:{x:i.endPoint.x+a,y:i.endPoint.y+c},bendPoints:(i.bendPoints??[]).map(l=>({x:l.x+a,y:l.y+c}))};else{const l=r.get(t.sources[0]),p=r.get(t.targets[0]);l&&p&&(m={sourcePoint:{x:l.x+l.width/2,y:l.y+l.height},targetPoint:{x:p.x+p.width/2,y:p.y},bendPoints:[]})}return{id:t.id,source:t.sources[0],target:t.targets[0],type:"elk",data:m,style:Fe(o),markerEnd:pe,...s?{label:s,labelStyle:{fill:"var(--text-muted)",fontSize:10},labelBgStyle:{fill:"var(--bg-primary)",fillOpacity:.8}}:{}}}async function Zt(t){var m,d;const r=Kt(t),o=await(await Yt()).layout(r),n=new Map;for(const l of t.nodes)if(n.set(l.id,{type:l.type,data:l.data}),l.data.subgraph)for(const p of l.data.subgraph.nodes)n.set(`${l.id}/${p.id}`,{type:p.type,data:p.data});const i=[],a=[],c=new Map;for(const l of o.children??[]){const p=l.x??0,j=l.y??0;c.set(l.id,{x:p,y:j,width:l.width??0,height:l.height??0});for(const y of l.children??[])c.set(y.id,{x:p+(y.x??0),y:j+(y.y??0),width:y.width??0,height:y.height??0})}for(const l of o.children??[]){const p=n.get(l.id);if((((m=l.children)==null?void 0:m.length)??0)>0){i.push({id:l.id,type:"groupNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:l.width,nodeHeight:l.height},position:{x:l.x??0,y:l.y??0},style:{width:l.width,height:l.height}});for(const k of l.children??[]){const w=n.get(k.id);i.push({id:k.id,type:(w==null?void 0:w.type)??"defaultNode",data:{...(w==null?void 0:w.data)??{},nodeWidth:k.width},position:{x:k.x??0,y:k.y??0},parentNode:l.id,extent:"parent"})}const y=l.x??0,C=l.y??0;for(const k of l.edges??[]){const w=t.nodes.find(B=>B.id===l.id),$=(d=w==null?void 0:w.data.subgraph)==null?void 0:d.edges.find(B=>`${l.id}/${B.id}`===k.id);a.push(_e(k,c,$==null?void 0:$.label,$==null?void 0:$.conditional,{x:y,y:C}))}}else i.push({id:l.id,type:(p==null?void 0:p.type)??"defaultNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:l.width},position:{x:l.x??0,y:l.y??0}})}for(const l of o.edges??[]){const p=t.edges.find(j=>j.id===l.id);a.push(_e(l,c,p==null?void 0:p.label,p==null?void 0:p.conditional))}return{nodes:i,edges:a}}function ae({entrypoint:t,runId:r,breakpointNode:s,breakpointNextNodes:o,onBreakpointChange:n,fitViewTrigger:i}){const[a,c,m]=Ze([]),[d,l,p]=Qe([]),[j,y]=h.useState(!0),[C,k]=h.useState(!1),[w,$]=h.useState(0),B=h.useRef(0),G=h.useRef(null),z=O(g=>g.breakpoints[r]),N=O(g=>g.toggleBreakpoint),H=O(g=>g.clearBreakpoints),T=O(g=>g.activeNodes[r]),W=O(g=>{var u;return(u=g.runs[r])==null?void 0:u.status}),J=h.useCallback((g,u)=>{if(u.type==="startNode"||u.type==="endNode")return;const x=u.type==="groupNode"?u.id:u.id.includes("/")?u.id.split("/").pop():u.id;N(r,x);const I=O.getState().breakpoints[r]??{};n==null||n(Object.keys(I))},[r,N,n]),D=z&&Object.keys(z).length>0,q=h.useCallback(()=>{if(D)H(r),n==null||n([]);else{const g=[];for(const x of a){if(x.type==="startNode"||x.type==="endNode"||x.parentNode)continue;const I=x.type==="groupNode"?x.id:x.id.includes("/")?x.id.split("/").pop():x.id;g.push(I)}for(const x of g)z!=null&&z[x]||N(r,x);const u=O.getState().breakpoints[r]??{};n==null||n(Object.keys(u))}},[r,D,z,a,H,N,n]);h.useEffect(()=>{c(g=>g.map(u=>{var f;if(u.type==="startNode"||u.type==="endNode")return u;const x=u.type==="groupNode"?u.id:u.id.includes("/")?u.id.split("/").pop():u.id,I=!!(z&&z[x]);return I!==!!((f=u.data)!=null&&f.hasBreakpoint)?{...u,data:{...u.data,hasBreakpoint:I}}:u}))},[z,c]),h.useEffect(()=>{const g=s?new Set(s.split(",").map(u=>u.trim()).filter(Boolean)):null;c(u=>u.map(x=>{var _,v;if(x.type==="startNode"||x.type==="endNode")return x;const I=x.type==="groupNode"?x.id:x.id.includes("/")?x.id.split("/").pop():x.id,f=(_=x.data)==null?void 0:_.label,S=g!=null&&(g.has(I)||f!=null&&g.has(f));return S!==!!((v=x.data)!=null&&v.isPausedHere)?{...x,data:{...x.data,isPausedHere:S}}:x}))},[s,w,c]);const U=O(g=>g.stateEvents[r]);h.useEffect(()=>{const g=!!s;let u=new Set;const x=new Set,I=new Set,f=new Set,S=new Map,_=new Map;if(U)for(const v of U)v.phase==="started"?_.set(v.node_name,v.qualified_node_name??null):v.phase==="completed"&&_.delete(v.node_name);c(v=>{var L;for(const P of v)P.type&&S.set(P.id,P.type);const E=P=>{var b;const A=[];for(const M of v){const V=M.type==="groupNode"?M.id:M.id.includes("/")?M.id.split("/").pop():M.id,F=(b=M.data)==null?void 0:b.label;(V===P||F!=null&&F===P)&&A.push(M.id)}return A};if(g&&s){const P=s.split(",").map(A=>A.trim()).filter(Boolean);for(const A of P)E(A).forEach(b=>u.add(b));if(o!=null&&o.length)for(const A of o)E(A).forEach(b=>I.add(b));T!=null&&T.prev&&E(T.prev).forEach(A=>x.add(A))}else if(_.size>0){const P=new Map;for(const A of v){const b=(L=A.data)==null?void 0:L.label;if(!b)continue;const M=A.id.includes("/")?A.id.split("/").pop():A.id;for(const V of[M,b]){let F=P.get(V);F||(F=new Set,P.set(V,F)),F.add(A.id)}}for(const[A,b]of _){let M=!1;if(b){const V=b.replace(/:/g,"/");for(const F of v)F.id===V&&(u.add(F.id),M=!0)}if(!M){const V=P.get(A);V&&V.forEach(F=>u.add(F))}}}return v}),l(v=>{const E=x.size===0||v.some(L=>u.has(L.target)&&x.has(L.source));return v.map(L=>{var A,b;let P;return g?P=u.has(L.target)&&(x.size===0||!E||x.has(L.source))||u.has(L.source)&&I.has(L.target):(P=u.has(L.source),!P&&S.get(L.target)==="endNode"&&u.has(L.target)&&(P=!0)),P?(g||f.add(L.target),{...L,style:{stroke:"var(--accent)",strokeWidth:2.5},markerEnd:{...pe,color:"var(--accent)"},data:{...L.data,highlighted:!0},animated:!0}):(A=L.data)!=null&&A.highlighted?{...L,style:Fe((b=L.data)==null?void 0:b.conditional),markerEnd:pe,data:{...L.data,highlighted:!1},animated:!1}:L})}),c(v=>v.map(E=>{var A,b,M,V;const L=!g&&u.has(E.id);if(E.type==="startNode"||E.type==="endNode"){const F=f.has(E.id)||!g&&u.has(E.id);return F!==!!((A=E.data)!=null&&A.isActiveNode)||L!==!!((b=E.data)!=null&&b.isExecutingNode)?{...E,data:{...E.data,isActiveNode:F,isExecutingNode:L}}:E}const P=g?I.has(E.id):f.has(E.id);return P!==!!((M=E.data)!=null&&M.isActiveNode)||L!==!!((V=E.data)!=null&&V.isExecutingNode)?{...E,data:{...E.data,isActiveNode:P,isExecutingNode:L}}:E}))},[U,T,s,o,W,w,c,l]);const R=O(g=>g.graphCache[r]);return h.useEffect(()=>{if(!R&&r!=="__setup__")return;const g=R?Promise.resolve(R):vt(t),u=++B.current;y(!0),k(!1),g.then(async x=>{if(B.current!==u)return;if(!x.nodes.length){k(!0);return}const{nodes:I,edges:f}=await Zt(x);if(B.current!==u)return;const S=O.getState().breakpoints[r],_=S?I.map(v=>{if(v.type==="startNode"||v.type==="endNode")return v;const E=v.type==="groupNode"?v.id:v.id.includes("/")?v.id.split("/").pop():v.id;return S[E]?{...v,data:{...v.data,hasBreakpoint:!0}}:v}):I;c(_),l(f),$(v=>v+1),setTimeout(()=>{var v;(v=G.current)==null||v.fitView({padding:.1,duration:200})},100)}).catch(()=>{B.current===u&&k(!0)}).finally(()=>{B.current===u&&y(!1)})},[t,r,R,c,l]),h.useEffect(()=>{const g=setTimeout(()=>{var u;(u=G.current)==null||u.fitView({padding:.1,duration:200})},100);return()=>clearTimeout(g)},[r]),h.useEffect(()=>{var g;i&&((g=G.current)==null||g.fitView({padding:.1,duration:200}))},[i]),h.useEffect(()=>{c(g=>{var L,P,A;const u=!!(U!=null&&U.length),x=W==="completed"||W==="failed",I=new Set,f=new Set(g.map(b=>b.id)),S=new Map;for(const b of g){const M=(L=b.data)==null?void 0:L.label;if(!M)continue;const V=b.id.includes("/")?b.id.split("/").pop():b.id;for(const F of[V,M]){let re=S.get(F);re||(re=new Set,S.set(F,re)),re.add(b.id)}}if(u)for(const b of U){let M=!1;if(b.qualified_node_name){const V=b.qualified_node_name.replace(/:/g,"/");f.has(V)&&(I.add(V),M=!0)}if(!M){const V=S.get(b.node_name);V&&V.forEach(F=>I.add(F))}}const _=new Set;for(const b of g)b.parentNode&&I.has(b.id)&&_.add(b.parentNode);let v;W==="failed"&&I.size===0&&(v=(P=g.find(b=>!b.parentNode&&b.type!=="startNode"&&b.type!=="endNode"&&b.type!=="groupNode"))==null?void 0:P.id);let E;if(W==="completed"){const b=(A=g.find(M=>!M.parentNode&&M.type!=="startNode"&&M.type!=="endNode"&&M.type!=="groupNode"))==null?void 0:A.id;b&&!I.has(b)&&(E=b)}return g.map(b=>{var V;let M;return b.id===v?M="failed":b.id===E||I.has(b.id)?M="completed":b.type==="startNode"?(!b.parentNode&&u||b.parentNode&&_.has(b.parentNode))&&(M="completed"):b.type==="endNode"?!b.parentNode&&x?M=W==="failed"?"failed":"completed":b.parentNode&&_.has(b.parentNode)&&(M="completed"):b.type==="groupNode"&&_.has(b.id)&&(M="completed"),M!==((V=b.data)==null?void 0:V.status)?{...b,data:{...b.data,status:M}}:b})})},[U,W,w,c]),j?e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:"Loading graph..."}):C?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",style:{color:"var(--text-muted)"},children:[e.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"38",y:"10",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"}),e.jsx("line",{x1:"60",y1:"34",x2:"60",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("rect",{x:"12",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("rect",{x:"64",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"60",y1:"46",x2:"34",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"60",y1:"46",x2:"86",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"34",y1:"70",x2:"34",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"86",y1:"70",x2:"86",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"34",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"86",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("line",{x1:"60",y1:"82",x2:"60",y2:"86",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),e.jsx("rect",{x:"38",y:"86",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"})]}),e.jsx("span",{className:"text-xs",children:"No graph schema available"})]}):e.jsxs("div",{className:"h-full graph-panel",children:[e.jsx("style",{children:`
+ .graph-panel .react-flow__handle {
+ opacity: 0 !important;
+ width: 0 !important;
+ height: 0 !important;
+ min-width: 0 !important;
+ min-height: 0 !important;
+ border: none !important;
+ pointer-events: none !important;
+ }
+ .graph-panel .react-flow__edges {
+ overflow: visible !important;
+ z-index: 1 !important;
+ }
+ .graph-panel .react-flow__edge.animated path {
+ stroke-dasharray: 8 4;
+ animation: edge-flow 0.6s linear infinite;
+ }
+ @keyframes edge-flow {
+ to { stroke-dashoffset: -12; }
+ }
+ @keyframes node-pulse-accent {
+ 0%, 100% { box-shadow: 0 0 4px var(--accent); }
+ 50% { box-shadow: 0 0 10px var(--accent); }
+ }
+ @keyframes node-pulse-green {
+ 0%, 100% { box-shadow: 0 0 4px var(--success); }
+ 50% { box-shadow: 0 0 10px var(--success); }
+ }
+ @keyframes node-pulse-red {
+ 0%, 100% { box-shadow: 0 0 4px var(--error); }
+ 50% { box-shadow: 0 0 10px var(--error); }
+ }
+ `}),e.jsxs(et,{nodes:a,edges:d,onNodesChange:m,onEdgesChange:p,nodeTypes:Ft,edgeTypes:Ut,onInit:g=>{G.current=g},onNodeClick:J,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[e.jsx(tt,{color:"var(--bg-tertiary)",gap:16}),e.jsx(rt,{showInteractive:!1}),e.jsx(st,{position:"top-right",children:e.jsxs("button",{onClick:q,title:D?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:D?"var(--error)":"var(--text-muted)",border:`1px solid ${D?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[e.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:D?"var(--error)":"var(--node-border)"}}),D?"Clear all":"Break all"]})}),e.jsx(ot,{nodeColor:g=>{var x;if(g.type==="groupNode")return"var(--bg-tertiary)";const u=(x=g.data)==null?void 0:x.status;return u==="completed"?"var(--success)":u==="running"?"var(--warning)":u==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const ee="__setup__";function Qt({entrypoint:t,mode:r,ws:s,onRunCreated:o,isMobile:n}){const[i,a]=h.useState("{}"),[c,m]=h.useState({}),[d,l]=h.useState(!1),[p,j]=h.useState(!0),[y,C]=h.useState(null),[k,w]=h.useState(""),[$,B]=h.useState(0),[G,z]=h.useState(!0),[N,H]=h.useState(()=>{const f=localStorage.getItem("setupTextareaHeight");return f?parseInt(f,10):140}),T=h.useRef(null),[W,J]=h.useState(()=>{const f=localStorage.getItem("setupPanelWidth");return f?parseInt(f,10):380}),D=r==="run";h.useEffect(()=>{j(!0),C(null),ft(t).then(f=>{m(f.mock_input),a(JSON.stringify(f.mock_input,null,2))}).catch(f=>{console.error("Failed to load mock input:",f);const S=f.detail||{};C(S.message||`Failed to load schema for "${t}"`),a("{}")}).finally(()=>j(!1))},[t]),h.useEffect(()=>{O.getState().clearBreakpoints(ee)},[]);const q=async()=>{let f;try{f=JSON.parse(i)}catch{alert("Invalid JSON input");return}l(!0);try{const S=O.getState().breakpoints[ee]??{},_=Object.keys(S),v=await ge(t,f,r,_);O.getState().clearBreakpoints(ee),O.getState().upsertRun(v),o(v.id)}catch(S){console.error("Failed to create run:",S)}finally{l(!1)}},U=async()=>{const f=k.trim();if(f){l(!0);try{const S=O.getState().breakpoints[ee]??{},_=Object.keys(S),v=await ge(t,c,"chat",_);O.getState().clearBreakpoints(ee),O.getState().upsertRun(v),O.getState().addLocalChatMessage(v.id,{message_id:`local-${Date.now()}`,role:"user",content:f}),s.sendChatMessage(v.id,f),o(v.id)}catch(S){console.error("Failed to create chat run:",S)}finally{l(!1)}}};h.useEffect(()=>{try{JSON.parse(i),z(!0)}catch{z(!1)}},[i]);const R=h.useCallback(f=>{f.preventDefault();const S="touches"in f?f.touches[0].clientY:f.clientY,_=N,v=L=>{const P="touches"in L?L.touches[0].clientY:L.clientY,A=Math.max(60,_+(S-P));H(A)},E=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(N))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[N]),g=h.useCallback(f=>{f.preventDefault();const S="touches"in f?f.touches[0].clientX:f.clientX,_=W,v=L=>{const P=T.current;if(!P)return;const A="touches"in L?L.touches[0].clientX:L.clientX,b=P.clientWidth-300,M=Math.max(280,Math.min(b,_+(S-A)));J(M)},E=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(W)),B(L=>L+1)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[W]),u=D?"Autonomous":"Conversational",x=D?"var(--success)":"var(--accent)",I=e.jsxs("div",{className:"shrink-0 flex flex-col",style:n?{background:"var(--bg-primary)"}:{width:W,background:"var(--bg-primary)"},children:[e.jsxs("div",{className:"px-4 text-xs font-semibold uppercase tracking-wider border-b flex items-center gap-2 h-[33px]",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[e.jsx("span",{style:{color:x},children:"●"}),u]}),e.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[e.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:D?e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}):e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),e.jsxs("div",{className:"text-center space-y-1.5",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:D?"Ready to execute":"Ready to chat"}),e.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",D?e.jsxs(e.Fragment,{children:[",",e.jsx("br",{}),"configure input below, then run"]}):e.jsxs(e.Fragment,{children:[",",e.jsx("br",{}),"then send your first message"]})]})]})]}),D?e.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!n&&e.jsx("div",{onMouseDown:R,onTouchStart:R,className:"shrink-0 h-1.5 cursor-row-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors"}),e.jsxs("div",{className:"px-4 py-3",children:[y?e.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:y}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block text-[10px] uppercase tracking-wider font-semibold mb-2",style:{color:"var(--text-muted)"},children:["Input",p&&e.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),e.jsx("textarea",{value:i,onChange:f=>a(f.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none focus:outline-none mb-3",style:{height:n?120:N,background:"var(--bg-secondary)",border:`1px solid ${G?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),e.jsx("button",{onClick:q,disabled:d||p||!!y,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:x,color:x},onMouseEnter:f=>{d||(f.currentTarget.style.background=`color-mix(in srgb, ${x} 10%, transparent)`)},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:d?"Starting...":e.jsxs(e.Fragment,{children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:k,onChange:f=>w(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),U())},disabled:d||p,placeholder:d?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 focus:outline-none disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:U,disabled:d||p||!k.trim(),className:"text-[11px] uppercase tracking-wider font-semibold px-2 py-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!d&&k.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:f=>{!d&&k.trim()&&(f.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:"Send"})]})]});return n?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:e.jsx(ae,{entrypoint:t,traces:[],runId:ee,fitViewTrigger:$})}),e.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:I})]}):e.jsxs("div",{ref:T,className:"flex h-full",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ae,{entrypoint:t,traces:[],runId:ee,fitViewTrigger:$})}),e.jsx("div",{onMouseDown:g,onTouchStart:g,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:e.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),I]})}const er={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function tr(t){const r=[],s=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let o=0,n;for(;(n=s.exec(t))!==null;){if(n.index>o&&r.push({type:"punctuation",text:t.slice(o,n.index)}),n[1]!==void 0){r.push({type:"key",text:n[1]});const i=t.indexOf(":",n.index+n[1].length);i!==-1&&(i>n.index+n[1].length&&r.push({type:"punctuation",text:t.slice(n.index+n[1].length,i)}),r.push({type:"punctuation",text:":"}),s.lastIndex=i+1)}else n[2]!==void 0?r.push({type:"string",text:n[2]}):n[3]!==void 0?r.push({type:"number",text:n[3]}):n[4]!==void 0?r.push({type:"boolean",text:n[4]}):n[5]!==void 0?r.push({type:"null",text:n[5]}):n[6]!==void 0&&r.push({type:"punctuation",text:n[6]});o=s.lastIndex}return otr(t),[t]);return e.jsx("pre",{className:r,style:s,children:o.map((n,i)=>e.jsx("span",{style:{color:er[n.type]},children:n.text},i))})}const rr={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},sr={color:"var(--text-muted)",label:"Unknown"};function or(t){if(typeof t!="string")return null;const r=t.trim();if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{return JSON.stringify(JSON.parse(r),null,2)}catch{return null}return null}function nr(t){if(t<1)return`${(t*1e3).toFixed(0)}us`;if(t<1e3)return`${t.toFixed(2)}ms`;if(t<6e4)return`${(t/1e3).toFixed(2)}s`;const r=Math.floor(t/6e4),s=(t%6e4/1e3).toFixed(1);return`${r}m ${s}s`}const Le=200;function ar(t){if(typeof t=="string")return t;if(t==null)return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function ir({value:t}){const[r,s]=h.useState(!1),o=ar(t),n=h.useMemo(()=>or(t),[t]),i=n!==null,a=n??o,c=a.length>Le||a.includes(`
+`),m=h.useCallback(()=>s(d=>!d),[]);return c?e.jsxs("div",{children:[r?i?e.jsx(te,{json:a,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):e.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:a}):e.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[a.slice(0,Le),"..."]}),e.jsx("button",{onClick:m,className:"text-[10px] cursor-pointer ml-1",style:{color:"var(--info)"},children:r?"[less]":"[more]"})]}):i?e.jsx(te,{json:a,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):e.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:a})}function cr({span:t}){const[r,s]=h.useState(!0),[o,n]=h.useState(!1),i=rr[t.status.toLowerCase()]??{...sr,label:t.status},a=new Date(t.timestamp).toLocaleTimeString(void 0,{hour12:!1,fractionalSecondDigits:3}),c=Object.entries(t.attributes),m=[{label:"Span",value:t.span_id},...t.trace_id?[{label:"Trace",value:t.trace_id}]:[],{label:"Run",value:t.run_id},...t.parent_span_id?[{label:"Parent",value:t.parent_span_id}]:[]];return e.jsxs("div",{className:"overflow-y-auto h-full text-xs leading-normal",children:[e.jsxs("div",{className:"px-2 py-1.5 border-b flex items-center gap-2 flex-wrap",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[e.jsx("span",{className:"text-xs font-semibold mr-auto",style:{color:"var(--text-primary)"},children:t.span_name}),e.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${i.color} 15%, var(--bg-secondary))`,color:i.color},children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:i.color}}),i.label]}),t.duration_ms!=null&&e.jsx("span",{className:"shrink-0 font-mono text-[11px] font-semibold",style:{color:"var(--warning)"},children:nr(t.duration_ms)}),e.jsx("span",{className:"shrink-0 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:a})]}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--accent)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>s(d=>!d),children:[e.jsxs("span",{className:"flex-1",children:["Attributes (",c.length,")"]}),e.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&c.map(([d,l],p)=>e.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:p%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[e.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:d,children:d}),e.jsx("span",{className:"flex-1 min-w-0",children:e.jsx(ir,{value:l})})]},d))]}),e.jsxs("div",{className:"px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--accent)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(d=>!d),children:[e.jsxs("span",{className:"flex-1",children:["Identifiers (",m.length,")"]}),e.jsx("span",{style:{color:"var(--text-muted)",transform:o?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),o&&m.map((d,l)=>e.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:l%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[e.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:d.label,children:d.label}),e.jsx("span",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:d.value})})]},d.label))]})}const lr={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function dr({kind:t,statusColor:r}){const s=r,o=14,n={width:o,height:o,viewBox:"0 0 16 16",fill:"none",stroke:s,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(t){case"LLM":return e.jsx("svg",{...n,children:e.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:s,stroke:"none"})});case"TOOL":return e.jsx("svg",{...n,children:e.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return e.jsxs("svg",{...n,children:[e.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),e.jsx("circle",{cx:"6",cy:"9",r:"1",fill:s,stroke:"none"}),e.jsx("circle",{cx:"10",cy:"9",r:"1",fill:s,stroke:"none"}),e.jsx("path",{d:"M8 2v3"}),e.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return e.jsxs("svg",{...n,children:[e.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),e.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),e.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return e.jsxs("svg",{...n,children:[e.jsx("circle",{cx:"7",cy:"7",r:"4"}),e.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return e.jsxs("svg",{...n,children:[e.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),e.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),e.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),e.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return e.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:r}})}}function ur(t){const r=new Map(t.map(a=>[a.span_id,a])),s=new Map;for(const a of t)if(a.parent_span_id){const c=s.get(a.parent_span_id)??[];c.push(a),s.set(a.parent_span_id,c)}const o=t.filter(a=>a.parent_span_id===null||!r.has(a.parent_span_id));function n(a){const c=(s.get(a.span_id)??[]).sort((m,d)=>m.timestamp.localeCompare(d.timestamp));return{span:a,children:c.map(n)}}return o.sort((a,c)=>a.timestamp.localeCompare(c.timestamp)).map(n).flatMap(a=>a.span.span_name==="root"?a.children:[a])}function pr(t){return t==null?"":t<1e3?`${t.toFixed(0)}ms`:`${(t/1e3).toFixed(2)}s`}function Ue(t){return t.map(r=>{const{span:s}=r;return r.children.length>0?{name:s.span_name,children:Ue(r.children)}:{name:s.span_name}})}function Te({traces:t}){const[r,s]=h.useState(null),[o,n]=h.useState(new Set),[i,a]=h.useState(()=>{const N=localStorage.getItem("traceTreeSplitWidth");return N?parseFloat(N):50}),[c,m]=h.useState(!1),[d,l]=h.useState(!1),p=ur(t),j=h.useMemo(()=>JSON.stringify(Ue(p),null,2),[t]),y=h.useCallback(()=>{navigator.clipboard.writeText(j).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},[j]),C=O(N=>N.focusedSpan),k=O(N=>N.setFocusedSpan),[w,$]=h.useState(null),B=h.useRef(null),G=h.useCallback(N=>{n(H=>{const T=new Set(H);return T.has(N)?T.delete(N):T.add(N),T})},[]);h.useEffect(()=>{if(r===null)p.length>0&&s(p[0].span);else{const N=t.find(H=>H.span_id===r.span_id);N&&N!==r&&s(N)}},[t]),h.useEffect(()=>{if(!C)return;const H=t.filter(T=>T.span_name===C.name).sort((T,W)=>T.timestamp.localeCompare(W.timestamp))[C.index];if(H){s(H),$(H.span_id);const T=new Map(t.map(W=>[W.span_id,W.parent_span_id]));n(W=>{const J=new Set(W);let D=H.parent_span_id;for(;D;)J.delete(D),D=T.get(D)??null;return J})}k(null)},[C,t,k]),h.useEffect(()=>{if(!w)return;const N=w;$(null),requestAnimationFrame(()=>{const H=B.current,T=H==null?void 0:H.querySelector(`[data-span-id="${N}"]`);H&&T&&T.scrollIntoView({block:"center",behavior:"smooth"})})},[w]),h.useEffect(()=>{if(!c)return;const N=T=>{const W=document.querySelector(".trace-tree-container");if(!W)return;const J=W.getBoundingClientRect(),D=(T.clientX-J.left)/J.width*100,q=Math.max(20,Math.min(80,D));a(q),localStorage.setItem("traceTreeSplitWidth",String(q))},H=()=>{m(!1)};return window.addEventListener("mousemove",N),window.addEventListener("mouseup",H),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",H)}},[c]);const z=N=>{N.preventDefault(),m(!0)};return e.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:c?"col-resize":void 0},children:[e.jsxs("div",{className:"pr-0.5 pt-0.5 relative",style:{width:`${i}%`},children:[t.length>0&&e.jsx("button",{onClick:y,className:"absolute top-2 left-2 z-20 text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-opacity",style:{opacity:d?1:.3,color:d?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:N=>{N.currentTarget.style.opacity="1"},onMouseLeave:N=>{d||(N.currentTarget.style.opacity="0.3")},children:d?"Copied!":"Copy JSON"}),e.jsx("div",{ref:B,className:"overflow-y-auto h-full p-0.5",children:p.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p.map((N,H)=>e.jsx(Je,{node:N,depth:0,selectedId:(r==null?void 0:r.span_id)??null,onSelect:s,isLast:H===p.length-1,collapsedIds:o,toggleExpanded:G},N.span.span_id))})]}),e.jsx("div",{onMouseDown:z,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",style:c?{background:"var(--accent)"}:void 0,children:e.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),e.jsx("div",{className:"flex-1 overflow-hidden p-0.5",children:r?e.jsx(cr,{span:r}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Je({node:t,depth:r,selectedId:s,onSelect:o,isLast:n,collapsedIds:i,toggleExpanded:a}){var k;const{span:c}=t,m=!i.has(c.span_id),d=lr[c.status.toLowerCase()]??"var(--text-muted)",l=pr(c.duration_ms),p=c.span_id===s,j=t.children.length>0,y=r*20,C=(k=c.attributes)==null?void 0:k["openinference.span.kind"];return e.jsxs("div",{className:"relative",children:[r>0&&e.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${y-10}px`,width:"1px",height:n?"16px":"100%",background:"var(--border)"}}),e.jsxs("button",{"data-span-id":c.span_id,onClick:()=>o(c),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${y+4}px`,background:p?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:p?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:w=>{p||(w.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:w=>{p||(w.currentTarget.style.background="")},children:[r>0&&e.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${y-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),j?e.jsx("span",{onClick:w=>{w.stopPropagation(),a(c.span_id)},className:"shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:m?"rotate(90deg)":"rotate(0deg)"},children:e.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):e.jsx("span",{className:"shrink-0 w-4"}),e.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:e.jsx(dr,{kind:C,statusColor:d})}),e.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:c.span_name}),l&&e.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:l})]}),m&&t.children.map((w,$)=>e.jsx(Je,{node:w,depth:r+1,selectedId:s,onSelect:o,isLast:$===t.children.length-1,collapsedIds:i,toggleExpanded:a},w.span.span_id))]})}const hr={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},xr={color:"var(--text-muted)",bg:"transparent"};function Me({logs:t}){const r=h.useRef(null),s=h.useRef(null),[o,n]=h.useState(!1);h.useEffect(()=>{var a;(a=s.current)==null||a.scrollIntoView({behavior:"smooth"})},[t.length]);const i=()=>{const a=r.current;a&&n(a.scrollTop>100)};return t.length===0?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):e.jsxs("div",{className:"h-full relative",children:[e.jsxs("div",{ref:r,onScroll:i,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[t.map((a,c)=>{const m=new Date(a.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=a.level.toUpperCase(),l=d.slice(0,4),p=hr[d]??xr,j=c%2===0;return e.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:j?"var(--bg-primary)":"var(--bg-secondary)"},children:[e.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:m}),e.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:l}),e.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:a.message})]},c)}),e.jsx("div",{ref:s})]}),o&&e.jsx("button",{onClick:()=>{var a;return(a=r.current)==null?void 0:a.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const mr={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},$e={color:"var(--text-muted)",label:""};function ne({events:t,runStatus:r}){const s=h.useRef(null),o=h.useRef(!0),[n,i]=h.useState(null),a=()=>{const c=s.current;c&&(o.current=c.scrollHeight-c.scrollTop-c.clientHeight<40)};return h.useEffect(()=>{o.current&&s.current&&(s.current.scrollTop=s.current.scrollHeight)}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:r==="running"?"Waiting for events...":"No events yet"})}):e.jsx("div",{ref:s,onScroll:a,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:t.map((c,m)=>{const d=new Date(c.timestamp).toLocaleTimeString(void 0,{hour12:!1}),l=c.payload&&Object.keys(c.payload).length>0,p=n===m,j=c.phase?mr[c.phase]??$e:$e;return e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>{l&&i(p?null:m)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:m%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:l?"pointer":"default"},children:[e.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:d}),e.jsx("span",{className:"shrink-0",style:{color:j.color},children:"●"}),e.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:c.node_name}),j.label&&e.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:j.label}),l&&e.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&l&&e.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:e.jsx(te,{json:JSON.stringify(c.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},m)})})}function Re({runId:t,status:r,ws:s,breakpointNode:o}){const n=r==="suspended",i=a=>{const c=O.getState().breakpoints[t]??{};s.setBreakpoints(t,Object.keys(c)),a==="step"?s.debugStep(t):a==="continue"?s.debugContinue(t):s.debugStop(t)};return e.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),e.jsx(ue,{label:"Step",onClick:()=>i("step"),disabled:!n,color:"var(--info)",active:n}),e.jsx(ue,{label:"Continue",onClick:()=>i("continue"),disabled:!n,color:"var(--success)",active:n}),e.jsx(ue,{label:"Stop",onClick:()=>i("stop"),disabled:!n,color:"var(--error)",active:n}),e.jsx("span",{className:"text-[10px] ml-auto truncate",style:{color:n?"var(--accent)":"var(--text-muted)"},children:n?o?`Paused at ${o}`:"Paused":r})]})}function ue({label:t,onClick:r,disabled:s,color:o,active:n}){return e.jsx("button",{onClick:r,disabled:s,className:"px-2.5 py-0.5 h-5 text-[10px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:n?o:"var(--text-muted)",background:n?`color-mix(in srgb, ${o} 10%, transparent)`:"transparent"},onMouseEnter:i=>{s||(i.currentTarget.style.background=`color-mix(in srgb, ${o} 20%, transparent)`)},onMouseLeave:i=>{i.currentTarget.style.background=n?`color-mix(in srgb, ${o} 10%, transparent)`:"transparent"},children:t})}const Ie=h.lazy(()=>Ve(()=>import("./ChatPanel-0HELh5u1.js"),__vite__mapDeps([2,1,3,4]))),gr=[],fr=[],vr=[],yr=[];function br({run:t,ws:r,isMobile:s}){const o=t.mode==="chat",[n,i]=h.useState(280),[a,c]=h.useState(()=>{const u=localStorage.getItem("chatPanelWidth");return u?parseInt(u,10):380}),[m,d]=h.useState("primary"),[l,p]=h.useState(o?"primary":"traces"),[j,y]=h.useState(0),C=h.useRef(null),k=h.useRef(null),w=h.useRef(!1),$=O(u=>u.traces[t.id]||gr),B=O(u=>u.logs[t.id]||fr),G=O(u=>u.chatMessages[t.id]||vr),z=O(u=>u.stateEvents[t.id]||yr),N=O(u=>u.breakpoints[t.id]);h.useEffect(()=>{r.setBreakpoints(t.id,N?Object.keys(N):[])},[t.id]);const H=h.useCallback(u=>{r.setBreakpoints(t.id,u)},[t.id,r]),T=h.useCallback(u=>{u.preventDefault(),w.current=!0;const x="touches"in u?u.touches[0].clientY:u.clientY,I=n,f=_=>{if(!w.current)return;const v=C.current;if(!v)return;const E="touches"in _?_.touches[0].clientY:_.clientY,L=v.clientHeight-100,P=Math.max(80,Math.min(L,I+(E-x)));i(P)},S=()=>{w.current=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",f),document.removeEventListener("touchend",S),document.body.style.cursor="",document.body.style.userSelect="",y(_=>_+1)};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",f),document.addEventListener("mouseup",S),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("touchend",S)},[n]),W=h.useCallback(u=>{u.preventDefault();const x="touches"in u?u.touches[0].clientX:u.clientX,I=a,f=_=>{const v=k.current;if(!v)return;const E="touches"in _?_.touches[0].clientX:_.clientX,L=v.clientWidth-300,P=Math.max(280,Math.min(L,I+(x-E)));c(P)},S=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",f),document.removeEventListener("touchend",S),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(a)),y(_=>_+1)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",f),document.addEventListener("mouseup",S),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("touchend",S)},[a]),J=o?"Chat":"Events",D=o?"var(--accent)":"var(--success)",q=u=>u==="primary"?D:u==="events"?"var(--success)":"var(--accent)",U=O(u=>u.activeInterrupt[t.id]??null),R=t.status==="running"?e.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:o?"Thinking...":"Running..."}):o&&t.status==="suspended"&&U?e.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(s){const u=[{id:"traces",label:"Traces",count:$.length},{id:"primary",label:J},...o?[{id:"events",label:"Events",count:z.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:B.length}];return e.jsxs("div",{className:"flex flex-col h-full",children:[(t.mode==="debug"||t.status==="suspended"&&!U||N&&Object.keys(N).length>0)&&e.jsx(Re,{runId:t.id,status:t.status,ws:r,breakpointNode:t.breakpoint_node}),e.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:e.jsx(ae,{entrypoint:t.entrypoint,traces:$,runId:t.id,breakpointNode:t.breakpoint_node,breakpointNextNodes:t.breakpoint_next_nodes,onBreakpointChange:H,fitViewTrigger:j})}),e.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[u.map(x=>e.jsxs("button",{onClick:()=>p(x.id),className:"px-2 py-0.5 h-5 text-[11px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer",style:{color:l===x.id?q(x.id):"var(--text-muted)",background:l===x.id?`color-mix(in srgb, ${q(x.id)} 10%, transparent)`:"transparent"},children:[x.label,x.count!==void 0&&x.count>0&&e.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:x.count})]},x.id)),R]}),e.jsxs("div",{className:"flex-1 overflow-hidden",children:[l==="traces"&&e.jsx(Te,{traces:$}),l==="primary"&&(o?e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:e.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:e.jsx(Ie,{messages:G,runId:t.id,runStatus:t.status,ws:r})}):e.jsx(ne,{events:z,runStatus:t.status})),l==="events"&&e.jsx(ne,{events:z,runStatus:t.status}),l==="io"&&e.jsx(Pe,{run:t}),l==="logs"&&e.jsx(Me,{logs:B})]})]})}const g=[{id:"primary",label:J},...o?[{id:"events",label:"Events",count:z.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:B.length}];return e.jsxs("div",{ref:k,className:"flex h-full",children:[e.jsxs("div",{ref:C,className:"flex flex-col flex-1 min-w-0",children:[(t.mode==="debug"||t.status==="suspended"&&!U||N&&Object.keys(N).length>0)&&e.jsx(Re,{runId:t.id,status:t.status,ws:r,breakpointNode:t.breakpoint_node}),e.jsx("div",{className:"shrink-0",style:{height:n},children:e.jsx(ae,{entrypoint:t.entrypoint,traces:$,runId:t.id,breakpointNode:t.breakpoint_node,breakpointNextNodes:t.breakpoint_next_nodes,onBreakpointChange:H,fitViewTrigger:j})}),e.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 h-1.5 cursor-row-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:e.jsx("div",{className:"absolute inset-0 -top-1 -bottom-1"})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(Te,{traces:$})})]}),e.jsx("div",{onMouseDown:W,onTouchStart:W,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:e.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),e.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:a,background:"var(--bg-primary)"},children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[g.map(u=>e.jsxs("button",{onClick:()=>d(u.id),className:"px-2 py-0.5 h-5 text-[11px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer",style:{color:m===u.id?q(u.id):"var(--text-muted)",background:m===u.id?`color-mix(in srgb, ${q(u.id)} 10%, transparent)`:"transparent"},onMouseEnter:x=>{m!==u.id&&(x.currentTarget.style.color="var(--text-primary)")},onMouseLeave:x=>{m!==u.id&&(x.currentTarget.style.color="var(--text-muted)")},children:[u.label,u.count!==void 0&&u.count>0&&e.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:u.count})]},u.id)),R]}),e.jsxs("div",{className:"flex-1 overflow-hidden",children:[m==="primary"&&(o?e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:e.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:e.jsx(Ie,{messages:G,runId:t.id,runStatus:t.status,ws:r})}):e.jsx(ne,{events:z,runStatus:t.status})),m==="events"&&e.jsx(ne,{events:z,runStatus:t.status}),m==="io"&&e.jsx(Pe,{run:t}),m==="logs"&&e.jsx(Me,{logs:B})]})]})]})}function Pe({run:t}){return e.jsxs("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[e.jsx(Oe,{title:"Input",color:"var(--success)",copyText:JSON.stringify(t.input_data,null,2),children:e.jsx(te,{json:JSON.stringify(t.input_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),t.output_data&&e.jsx(Oe,{title:"Output",color:"var(--accent)",copyText:typeof t.output_data=="string"?t.output_data:JSON.stringify(t.output_data,null,2),children:e.jsx(te,{json:typeof t.output_data=="string"?t.output_data:JSON.stringify(t.output_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),t.error&&e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[e.jsxs("div",{className:"px-4 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[e.jsx("span",{children:"Error"}),e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:t.error.code}),e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:t.error.category})]}),e.jsxs("div",{className:"p-4 text-xs leading-normal",style:{background:"var(--bg-secondary)"},children:[e.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:t.error.title}),e.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:t.error.detail})]})]})]})}function Oe({title:t,color:r,copyText:s,children:o}){const[n,i]=h.useState(!1),a=h.useCallback(()=>{s&&navigator.clipboard.writeText(s).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[s]);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-1 h-4 rounded-full",style:{background:r}}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:r},children:t}),s&&e.jsx("button",{onClick:a,className:"ml-auto text-[10px] cursor-pointer px-1.5 py-0.5 rounded",style:{color:n?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:n?"Copied":"Copy"})]}),o]})}function jr(){const{reloadPending:t,setReloadPending:r,setEntrypoints:s}=O(),[o,n]=h.useState(!1);if(!t)return null;const i=async()=>{n(!0);try{await bt();const a=await He();s(a.map(c=>c.name)),r(!1)}catch(a){console.error("Reload failed:",a)}finally{n(!1)}};return e.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[e.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed — reload to apply"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:i,disabled:o,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:o?.6:1},children:o?"Reloading...":"Reload"}),e.jsx("button",{onClick:()=>r(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}function wr(){const t=mt(),r=Nt(),[s,o]=h.useState(!1),{runs:n,selectedRunId:i,setRuns:a,upsertRun:c,selectRun:m,setTraces:d,setLogs:l,setChatMessages:p,setEntrypoints:j,setStateEvents:y,setGraphCache:C,setActiveNode:k,removeActiveNode:w}=O(),{view:$,runId:B,setupEntrypoint:G,setupMode:z,navigate:N}=Be();h.useEffect(()=>{$==="details"&&B&&B!==i&&m(B)},[$,B,i,m]);const H=Ae(R=>R.init);h.useEffect(()=>{yt().then(a).catch(console.error),He().then(R=>j(R.map(g=>g.name))).catch(console.error),H()},[a,j,H]);const T=i?n[i]:null,W=h.useCallback((R,g)=>{c(g),d(R,g.traces),l(R,g.logs);const u=g.messages.map(x=>{const I=x.contentParts??x.content_parts??[],f=x.toolCalls??x.tool_calls??[];return{message_id:x.messageId??x.message_id,role:x.role??"assistant",content:I.filter(S=>{const _=S.mimeType??S.mime_type??"";return _.startsWith("text/")||_==="application/json"}).map(S=>{const _=S.data;return(_==null?void 0:_.inline)??""}).join(`
+`).trim()??"",tool_calls:f.length>0?f.map(S=>({name:S.name??"",has_result:!!S.result})):void 0}});if(p(R,u),g.graph&&g.graph.nodes.length>0&&C(R,g.graph),g.states&&g.states.length>0&&(y(R,g.states.map(x=>({node_name:x.node_name,qualified_node_name:x.qualified_node_name,phase:x.phase,timestamp:new Date(x.timestamp).getTime(),payload:x.payload}))),g.status!=="completed"&&g.status!=="failed"))for(const x of g.states)x.phase==="started"?k(R,x.node_name,x.qualified_node_name):x.phase==="completed"&&w(R,x.node_name)},[c,d,l,p,y,C,k,w]);h.useEffect(()=>{if(!i)return;t.subscribe(i),le(i).then(g=>W(i,g)).catch(console.error);const R=setTimeout(()=>{const g=O.getState().runs[i];g&&(g.status==="pending"||g.status==="running")&&le(i).then(u=>W(i,u)).catch(console.error)},2e3);return()=>{clearTimeout(R),t.unsubscribe(i)}},[i,t,W]);const J=h.useRef(null);h.useEffect(()=>{var u,x;if(!i)return;const R=T==null?void 0:T.status,g=J.current;if(J.current=R??null,R&&(R==="completed"||R==="failed")&&g!==R){const I=O.getState(),f=((u=I.traces[i])==null?void 0:u.length)??0,S=((x=I.logs[i])==null?void 0:x.length)??0,_=(T==null?void 0:T.trace_count)??0,v=(T==null?void 0:T.log_count)??0;(f<_||SW(i,E)).catch(console.error)}},[i,T==null?void 0:T.status,W]);const D=R=>{N(`#/runs/${R}/traces`),m(R),o(!1)},q=R=>{N(`#/runs/${R}/traces`),m(R),o(!1)},U=()=>{N("#/new"),o(!1)};return e.jsxs("div",{className:"flex h-screen w-screen relative",children:[r&&!s&&e.jsx("button",{onClick:()=>o(!0),className:"fixed top-2 left-2 z-40 w-9 h-9 flex items-center justify-center rounded-lg cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[e.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),e.jsx(Ct,{runs:Object.values(n),selectedRunId:i,onSelectRun:q,onNewRun:U,isMobile:r,isOpen:s,onClose:()=>o(!1)}),e.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:$==="new"?e.jsx(_t,{}):$==="setup"&&G&&z?e.jsx(Qt,{entrypoint:G,mode:z,ws:t,onRunCreated:D,isMobile:r}):T?e.jsx(br,{run:T,ws:t,isMobile:r}):e.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"})}),e.jsx(jr,{})]})}Ye.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(wr,{})}));export{O as u};
diff --git a/src/uipath/dev/server/static/assets/index-CwdGgmxN.css b/src/uipath/dev/server/static/assets/index-CwdGgmxN.css
new file mode 100644
index 0000000..f345ef5
--- /dev/null
+++ b/src/uipath/dev/server/static/assets/index-CwdGgmxN.css
@@ -0,0 +1 @@
+/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--spacing:.25rem;--container-xl:36rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-1{top:calc(var(--spacing)*-1)}.top-0{top:calc(var(--spacing)*0)}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.-right-1{right:calc(var(--spacing)*-1)}.right-3{right:calc(var(--spacing)*3)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.-left-1{left:calc(var(--spacing)*-1)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-2{margin-block:calc(var(--spacing)*2)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2\.5{margin-top:calc(var(--spacing)*2.5)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\[33px\]{height:33px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing)*48)}.min-h-0{min-height:calc(var(--spacing)*0)}.w-1{width:calc(var(--spacing)*1)}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-9{width:calc(var(--spacing)*9)}.w-44{width:calc(var(--spacing)*44)}.w-64{width:calc(var(--spacing)*64)}.w-full{width:100%}.w-screen{width:100vw}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[400px\]{min-width:400px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--border\)\]{background-color:var(--border)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-0\.5{padding-top:calc(var(--spacing)*.5)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-px{padding-top:1px}.pr-0\.5{padding-right:calc(var(--spacing)*.5)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-2\.5{padding-left:calc(var(--spacing)*2.5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--accent\)\]:hover{background-color:var(--accent)}.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#1e293b;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0c1222;--card-bg:#1e293b;--input-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--card-bg:#fff;--input-bg:#f8fafc;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--bg-primary);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--bg-primary);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--bg-primary);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--bg-primary)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
diff --git a/src/uipath/dev/server/static/assets/index-Dp7Ms2kW.css b/src/uipath/dev/server/static/assets/index-Dp7Ms2kW.css
deleted file mode 100644
index 871fa2f..0000000
--- a/src/uipath/dev/server/static/assets/index-Dp7Ms2kW.css
+++ /dev/null
@@ -1 +0,0 @@
-/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--spacing:.25rem;--container-xl:36rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-1{top:calc(var(--spacing)*-1)}.top-0{top:calc(var(--spacing)*0)}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.-right-1{right:calc(var(--spacing)*-1)}.right-3{right:calc(var(--spacing)*3)}.-bottom-1{bottom:calc(var(--spacing)*-1)}.-left-1{left:calc(var(--spacing)*-1)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-2{margin-block:calc(var(--spacing)*2)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2\.5{margin-top:calc(var(--spacing)*2.5)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-1{height:calc(var(--spacing)*1)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\[33px\]{height:33px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing)*48)}.min-h-0{min-height:calc(var(--spacing)*0)}.w-1{width:calc(var(--spacing)*1)}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-6{width:calc(var(--spacing)*6)}.w-9{width:calc(var(--spacing)*9)}.w-44{width:calc(var(--spacing)*44)}.w-64{width:calc(var(--spacing)*64)}.w-full{width:100%}.w-screen{width:100vw}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[400px\]{min-width:400px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--border\)\]{background-color:var(--border)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-0\.5{padding-top:calc(var(--spacing)*.5)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-px{padding-top:1px}.pr-0\.5{padding-right:calc(var(--spacing)*.5)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-2\.5{padding-left:calc(var(--spacing)*2.5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--accent\)\]:hover{background-color:var(--accent)}.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#1e293b;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0c1222;--card-bg:#1e293b;--input-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--card-bg:#fff;--input-bg:#f8fafc;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--bg-tertiary);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--bg-primary);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--bg-primary);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--bg-primary);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--bg-primary)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
diff --git a/src/uipath/dev/server/static/index.html b/src/uipath/dev/server/static/index.html
index 7b8e4d7..ee8c6e4 100644
--- a/src/uipath/dev/server/static/index.html
+++ b/src/uipath/dev/server/static/index.html
@@ -5,11 +5,11 @@
UiPath Developer Console
-
+
-
+
diff --git a/tests/e2e/test_web_run.py b/tests/e2e/test_web_run.py
index 53df6bb..7e4a9f2 100644
--- a/tests/e2e/test_web_run.py
+++ b/tests/e2e/test_web_run.py
@@ -12,7 +12,7 @@ def _wait_for_entrypoints(page: Page) -> None:
"""Wait until the entrypoint dropdown has real options loaded."""
page.wait_for_function(
"() => {"
- " const s = document.querySelector('select');"
+ " const s = document.querySelector('#entrypoint-select');"
" return s && s.options.length > 0"
" && !s.options[0].text.includes('Loading');"
"}",
@@ -23,7 +23,7 @@ def _wait_for_entrypoints(page: Page) -> None:
def _go_to_new_run(page: Page, url: str) -> None:
"""Navigate to the new run page and wait for entrypoints."""
page.goto(f"{url}/#/new")
- expect(page.get_by_role("combobox")).to_be_visible()
+ expect(page.locator("#entrypoint-select")).to_be_visible()
_wait_for_entrypoints(page)
@@ -54,7 +54,7 @@ def test_new_run_page_loads(page: Page, live_server_url: str):
expect(page.get_by_text("New Run", exact=True)).to_be_visible()
# Dropdown should have at least one real entrypoint
- combo = page.get_by_role("combobox")
+ combo = page.locator("#entrypoint-select")
option_count = combo.evaluate("el => el.options.length")
assert option_count >= 1
diff --git a/uv.lock b/uv.lock
index 469b62f..589b8bf 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1400,7 +1400,7 @@ wheels = [
[[package]]
name = "uipath-dev"
-version = "0.0.56"
+version = "0.0.57"
source = { editable = "." }
dependencies = [
{ name = "fastapi" },