Skip to content

Automate browser based workflows with AI

Add packaged UI pip install flow (#6159)

Suchintandc4eec23c8b1
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1597d0552..ee37503b1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,6 +7,8 @@ on:
pull_request:
push:
branches: [main]
+permissions:
+ contents: read
jobs:
test:
name: Run tests and pre-commit hooks
@@ -128,3 +130,35 @@ jobs:
run: npm run lint
- name: Run build
run: npm run build
+ pip-package-smoke:
+ name: pip Package Smoke Tests (${{ matrix.python-version }})
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ python-version: ["3.11", "3.13"]
+ steps:
+ - name: Check out Git repository
+ uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+ with:
+ persist-credentials: false
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install uv
+ run: |
+ curl -LsSf https://astral.sh/uv/install.sh | sh
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+ - name: Cache uv global cache
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
+ with:
+ path: ~/.cache/uv
+ key: uv-cache-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
+ - name: Set up Node.js
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
+ with:
+ node-version-file: .nvmrc
+ cache: npm
+ cache-dependency-path: skyvern-frontend/package-lock.json
+ - name: Run pip package smoke tests
+ run: PYTHON_IMAGE=python:${{ matrix.python-version }}-slim scripts/test-pip-ui-package.sh
diff --git a/.github/workflows/sdk-release.yml b/.github/workflows/sdk-release.yml
index 02c140250..b483f839a 100644
--- a/.github/workflows/sdk-release.yml
+++ b/.github/workflows/sdk-release.yml
@@ -6,6 +6,8 @@ on:
- main
paths:
- 'pyproject.toml'
+permissions:
+ contents: read
jobs:
check-version-change:
runs-on: ubuntu-latest
@@ -59,33 +61,69 @@ jobs:
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- # Cache uv's global cache (resolver/downloads) for speed
- - name: Cache uv cache
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
+ - name: Set up Node.js
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
- path: ~/.cache/uv
- key: uv-cache-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
- # Cache the project venv (keyed by lockfile + Python)
- - name: Cache venv
- id: cache-venv
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
- with:
- path: .venv
- key: venv-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version || '3.11' }}-${{ hashFiles('**/uv.lock') }}
- # Create/refresh environment. We install dev deps to get twine/build.
+ node-version-file: .nvmrc
+ # Create/refresh environment. Avoid restoring build caches in the publishing
+ # job so release artifacts are built only from the checked-out source.
- name: Sync dependencies
- if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
uv sync --group dev
- - name: Ensure environment is up to date (on cache hit)
- if: steps.cache-venv.outputs.cache-hit == 'true'
- run: uv sync --group dev
- name: Clean dist directory
run: rm -rf dist
- - name: Build Package
- run: uv build
- - name: Publish to PyPI
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- run: uv run twine upload --repository pypi dist/*
+ - name: Verify package versions match
+ run: |
+ python - <<'PY'
+ from pathlib import Path
+ import tomllib
+
+ root_version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
+ ui_version = tomllib.loads(Path("packages/skyvern-ui/pyproject.toml").read_text())["project"]["version"]
+ if root_version != ui_version:
+ raise SystemExit(f"skyvern version {root_version} does not match skyvern-ui version {ui_version}")
+ print(f"Building skyvern and skyvern-ui version {root_version}")
+ PY
+ - name: Build prebuilt UI package
+ run: scripts/build-skyvern-ui-package.sh dist/skyvern-ui
+ - name: Build Skyvern package
+ run: uv build --out-dir dist/skyvern
+ - name: Upload skyvern-ui distribution
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: skyvern-ui-dist
+ path: dist/skyvern-ui/*
+ if-no-files-found: error
+ retention-days: 7
+ - name: Upload skyvern distribution
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: skyvern-dist
+ path: dist/skyvern/*
+ if-no-files-found: error
+ retention-days: 7
+ publish-sdk:
+ runs-on: ubuntu-latest
+ needs: build-sdk
+ permissions:
+ contents: read
+ id-token: write
+ steps:
+ - name: Download skyvern-ui distribution
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: skyvern-ui-dist
+ path: dist/skyvern-ui
+ - name: Download skyvern distribution
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: skyvern-dist
+ path: dist/skyvern
+ - name: Publish skyvern-ui to PyPI
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
+ with:
+ packages-dir: dist/skyvern-ui/
+ - name: Publish skyvern to PyPI
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
+ with:
+ packages-dir: dist/skyvern/
diff --git a/README.md b/README.md
index c175ab9f2..fb88402cd 100644
--- a/README.md
+++ b/README.md
@@ -65,13 +65,12 @@ If you'd like to try it out, navigate to [app.skyvern.com](https://app.skyvern.c
Choose your preferred setup method:
-> **Database default**: As of skyvern 1.0.31+, `skyvern run server` defaults to a SQLite database at `~/.skyvern/data.db` so it works out of the box with no Postgres setup. To use Postgres instead, set `DATABASE_STRING` in `.env` or pass `--database-string` to `skyvern quickstart`. Docker Compose always uses the bundled Postgres service.
+> **Database default**: `skyvern quickstart` and `skyvern run server` default to a SQLite database at `~/.skyvern/data.db` so the pip path works without Postgres or Docker. To use Postgres instead, pass `--postgres` for a local container or `--database-string` for an existing database. Docker Compose always uses the bundled Postgres service.
-### Option A: pip install (Recommended)
+### Option A: pip install (Recommended for Python-managed local setup)
Dependencies needed:
-- [Python 3.11.x](https://www.python.org/downloads/), works with 3.12, not ready yet for 3.13
-- [NodeJS & NPM](https://nodejs.org/en/download/)
+- [Python 3.11, 3.12, or 3.13](https://www.python.org/downloads/)
Additionally, for Windows:
- [Rust](https://rustup.rs/)
@@ -80,7 +79,7 @@ Additionally, for Windows:
#### 1. Install Skyvern
```bash
-pip install skyvern
+pip install "skyvern[all]"
```
#### 2. Run Skyvern
@@ -89,6 +88,8 @@ pip install skyvern
skyvern quickstart
```
+The pip quickstart uses SQLite by default. For a local Postgres container, run `skyvern quickstart --postgres`.
+
### Option B: Docker Compose
Use this option if you want everything containerized (Postgres, API, UI) and don't want to install Python/Node locally.
@@ -132,7 +133,11 @@ uv pip install skyvern
**Skyvern is a Playwright extension that adds AI-powered browser automation.** It gives you the full power of Playwright with additional AI capabilities—use natural language prompts to interact with elements, extract data, and automate complex multi-step workflows.
**Installation:**
-- Python: `pip install skyvern` then run `skyvern quickstart` for local setup
+- Python SDK / cloud API: `pip install skyvern`
+- Local server + packaged UI: `pip install "skyvern[all]"` then run `skyvern quickstart`
+- Local server + packaged UI with Postgres: `pip install "skyvern[all]"` then run `skyvern quickstart --postgres`
+- Packaged UI for an existing API: `pip install "skyvern[ui]"` then run
+ `skyvern run ui --api-url <api-url> --api-key <api-key>`
- TypeScript: `npm install @skyvern/client`
### AI-Powered Page Commands
@@ -204,7 +209,12 @@ summary = await page.prompt("Summarize what's on this page")
```bash
skyvern run all
```
-Navigate to http://localhost:8080 to run tasks through the web interface.
+Navigate to http://localhost:8080 to run tasks through the web interface. If the packaged UI is missing, `skyvern run ui` will offer to install the matching UI package. For non-interactive setup, use `skyvern run ui --install-ui` or `skyvern run all --install-ui`.
+
+To run only the packaged UI against an existing Skyvern API, install `skyvern[ui]` and pass
+`--api-url`; the CLI infers `--wss-url` from the API URL unless you override it. You can also set
+`VITE_API_BASE_URL`, `VITE_WSS_BASE_URL`, `VITE_ARTIFACT_API_BASE_URL`, `VITE_SKYVERN_API_KEY`,
+and `VITE_BROWSER_STREAMING_MODE` before running `skyvern run ui`.
**Python SDK:**
```python
diff --git a/docs/developers/getting-started/quickstart.mdx b/docs/developers/getting-started/quickstart.mdx
index 602afef32..69ea0fed9 100644
--- a/docs/developers/getting-started/quickstart.mdx
+++ b/docs/developers/getting-started/quickstart.mdx
@@ -42,7 +42,7 @@ npm install @skyvern/client
</CodeGroup>
<Info>
-`pip install skyvern` is the lightweight Python SDK for Skyvern Cloud and remote API usage. If you are using embedded local mode with `Skyvern.local()` or `launch_local_browser()`, install the local extra: `pip install "skyvern[local]"`. For a local Skyvern server, self-hosted instance, or local stdio MCP, install the server extra instead: `pip install "skyvern[server]"`. For full local setup with migrations and the web UI, use Docker Compose or a source checkout.
+`pip install skyvern` is the lightweight Python SDK for Skyvern Cloud and remote API usage. If you are using embedded local mode with `Skyvern.local()` or `launch_local_browser()`, install the local extra: `pip install "skyvern[local]"`. For a local Skyvern server with the packaged web UI, use `pip install "skyvern[all]"`. For advanced partial installs, `skyvern[server]` installs only the local server stack and `skyvern[ui]` installs only the packaged UI assets.
</Info>
<Accordion title="Troubleshooting: Python version errors">
@@ -196,13 +196,12 @@ This is invaluable for debugging and understanding how Skyvern interprets your p
You can run Skyvern with a browser on your own machine. This is useful for development, debugging, or automating internal tools on your local network.
**Prerequisites:**
-- Skyvern server extra installed (`pip install "skyvern[server]"`)
-- Source checkout or Docker Compose for guided quickstart and database migrations
-- PostgreSQL database (local install or Docker)
+- Skyvern local server + packaged UI extra installed (`pip install "skyvern[all]"`)
+- If you intentionally installed only `skyvern[server]`, add the packaged UI with `pip install "skyvern[ui]"`. If it is missing, `skyvern run ui` can install it interactively; use `skyvern run ui --install-ui` for non-interactive UI-only setup.
- An LLM API key (OpenAI, Anthropic, Azure OpenAI, Gemini, Ollama, or any OpenAI-compatible provider)
<Note>
-Docker is optional. If you have PostgreSQL installed locally, Skyvern will detect and use it automatically. Use `skyvern init --no-postgres` to skip database setup entirely if you're managing PostgreSQL separately. The PyPI wheel installs the local-server dependencies, but guided quickstart currently needs repository migration files from a source checkout.
+The pip quickstart uses SQLite at `~/.skyvern/data.db` by default, so Docker and Postgres are optional. Use `skyvern quickstart --postgres` to start a local Postgres container, or `skyvern quickstart --database-string=...` for an existing database.
</Note>
### Set up local Skyvern
@@ -221,7 +220,7 @@ skyvern init
This interactive wizard will:
-1. Set up your database (detects local PostgreSQL or uses Docker)
+1. Set up your database (SQLite by default, Postgres if requested)
2. Configure your LLM provider
3. Choose browser mode (headless, headful, or connect to existing Chrome)
4. Generate local API credentials
diff --git a/docs/developers/self-hosted/overview.mdx b/docs/developers/self-hosted/overview.mdx
index 830290e71..e92f99d97 100644
--- a/docs/developers/self-hosted/overview.mdx
+++ b/docs/developers/self-hosted/overview.mdx
@@ -89,11 +89,11 @@ Before deploying, ensure you have:
PostgreSQL 14+ is included in the Docker Compose setup. If you prefer an external database, configure `DATABASE_STRING` to point to your own instance.
-For local server commands from PyPI, install the server extra: `pip install "skyvern[server]"`. The lightweight `pip install skyvern` package is for Skyvern Cloud / remote API SDK usage and does not include the local server stack. Guided quickstart and migrations currently require Docker Compose or a source checkout.
+For local server commands with the packaged web UI from PyPI, install `pip install "skyvern[all]"`. The pip quickstart uses SQLite at `~/.skyvern/data.db` by default; pass `--postgres` for a local Postgres container or `--database-string` for an existing database. Use `skyvern[server]` only when you intentionally want the local server stack without the packaged UI, and add `skyvern[ui]` later if needed. The lightweight `pip install skyvern` package is for Skyvern Cloud / remote API SDK usage and does not include the local server stack.
For a full self-hosted deployment with the web UI, use Docker Compose. The Compose stack starts the API server, browser runtime, Postgres, and the Skyvern web UI together.
-For the source-checkout `pip install ".[server]"` path (Option A in the README), the default is a SQLite database at `~/.skyvern/data.db` — zero-config for local dev. To opt into Postgres for that path, run `skyvern quickstart --database-string=postgresql+psycopg://user:pass@host:5432/dbname`.
+For the source-checkout `pip install ".[server]"` path, the default is also SQLite for local dev. To opt into Postgres for that path, run `skyvern quickstart --postgres` or `skyvern quickstart --database-string=postgresql+psycopg://user:pass@host:5432/dbname`.
## Choose your deployment method
diff --git a/docs/sdk-reference/complete-reference.mdx b/docs/sdk-reference/complete-reference.mdx
index 80cd0ef8f..7d3992836 100644
--- a/docs/sdk-reference/complete-reference.mdx
+++ b/docs/sdk-reference/complete-reference.mdx
@@ -33,7 +33,7 @@ npm install @skyvern/client
</CodeGroup>
<Note>
-`pip install skyvern` is the lightweight SDK for Skyvern Cloud and remote API calls. Embedded local SDK features such as `Skyvern.local()` and local browser control require `pip install "skyvern[local]"`. Local server and local stdio MCP commands require `pip install "skyvern[server]"`. Guided quickstart and migrations currently require Docker Compose or a source checkout.
+`pip install skyvern` is the lightweight SDK for Skyvern Cloud and remote API calls. Embedded local SDK features such as `Skyvern.local()` and local browser control require `pip install "skyvern[local]"`. For a local server with the packaged web UI and default SQLite database, use `pip install "skyvern[all]"`. Use `skyvern[server]` or `skyvern[ui]` only when you intentionally want one side without the other.
</Note>
<CodeGroup>
diff --git a/docs/sdk-reference/overview.mdx b/docs/sdk-reference/overview.mdx
index 6d762c536..f8341efcd 100644
--- a/docs/sdk-reference/overview.mdx
+++ b/docs/sdk-reference/overview.mdx
@@ -32,7 +32,7 @@ npm install @skyvern/client
</CodeGroup>
<Note>
-`pip install skyvern` is the lightweight SDK for Skyvern Cloud and remote API calls. Embedded local SDK features such as `Skyvern.local()` and local browser control require `pip install "skyvern[local]"`. Local server and local stdio MCP commands require `pip install "skyvern[server]"`. Guided quickstart and migrations currently require Docker Compose or a source checkout.
+`pip install skyvern` is the lightweight SDK for Skyvern Cloud and remote API calls. Embedded local SDK features such as `Skyvern.local()` and local browser control require `pip install "skyvern[local]"`. For a local server with the packaged web UI and default SQLite database, use `pip install "skyvern[all]"`. Use `skyvern[server]` or `skyvern[ui]` only when you intentionally want one side without the other.
</Note>
---
diff --git a/packages/skyvern-ui/README.md b/packages/skyvern-ui/README.md
new file mode 100644
index 000000000..ff865db02
--- /dev/null
+++ b/packages/skyvern-ui/README.md
@@ -0,0 +1,9 @@
+# skyvern-ui
+
+Prebuilt Skyvern frontend assets for `pip install "skyvern[ui]"`.
+
+This package is produced by the Skyvern release process after building
+`skyvern-frontend` with Vite placeholder values. It should contain the generated
+`skyvern_ui/dist/` directory. The Python CLI copies those assets to a writable
+cache, injects local runtime values, and serves them without requiring Node or
+npm on the user's machine.
diff --git a/packages/skyvern-ui/pyproject.toml b/packages/skyvern-ui/pyproject.toml
new file mode 100644
index 000000000..4037f0d4f
--- /dev/null
+++ b/packages/skyvern-ui/pyproject.toml
@@ -0,0 +1,22 @@
+[project]
+name = "skyvern-ui"
+version = "1.0.36"
+description = "Prebuilt Skyvern UI assets for the Skyvern CLI"
+authors = [{ name = "Skyvern AI", email = "[email protected]" }]
+requires-python = ">=3.11,<3.14"
+readme = "README.md"
+
+[tool.hatch.build]
+packages = ["skyvern_ui"]
+
+[tool.hatch.build.targets.wheel]
+include = ["skyvern_ui"]
+artifacts = ["skyvern_ui/dist/**"]
+
+[tool.hatch.build.targets.sdist]
+include = ["skyvern_ui", "README.md"]
+artifacts = ["skyvern_ui/dist/**"]
+
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
diff --git a/packages/skyvern-ui/skyvern_ui/__init__.py b/packages/skyvern-ui/skyvern_ui/__init__.py
new file mode 100644
index 000000000..d444779ec
--- /dev/null
+++ b/packages/skyvern-ui/skyvern_ui/__init__.py
@@ -0,0 +1,3 @@
+"""Prebuilt Skyvern UI assets."""
+
+__version__ = "1.0.36"
diff --git a/pyproject.toml b/pyproject.toml
index 88e9ce80c..15bd53e9b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -157,6 +157,86 @@ server = [
"tornado>=6.5.5",
"aiosqlite>=0.21.0,<0.23",
]
+ui = [
+ # Extras cannot add files to the already-installed skyvern wheel. Keep the
+ # frontend as a separate same-version distribution containing prebuilt dist
+ # assets, and let the CLI serve those assets without Node/npm at runtime.
+ "skyvern-ui==1.0.36",
+]
+all = [
+ # Keep this list in sync with the server extra plus skyvern-ui. Python
+ # package metadata cannot reference another extra from the same project in a
+ # way that pip reliably expands for all installers.
+ "skyvern-ui==1.0.36",
+ "azure-storage-blob>=12.26.0",
+ "openai>=1.68.2",
+ "yutori>=0.5.0",
+ "openai-agents>=0.10.5,<0.15",
+ "python-dotenv==1.2.2",
+ "sqlalchemy[mypy]>=2.0.29,<3",
+ "aiohttp>=3.13.4,<4",
+ "python-multipart>=0.0.27,<1",
+ "toml>=0.10.2,<0.11",
+ "jinja2>=3.1.2,<4",
+ "uvicorn[standard]>=0.44.0",
+ "litellm==1.83.14",
+ "playwright>1.46.0 ; python_version >= '3.12' and python_version < '3.14'",
+ "playwright==1.46.0 ; python_version >= '3.11' and python_version < '3.12'",
+ "greenlet>3.0.3 ; python_version >= '3.12' and python_version < '3.14'",
+ "greenlet==3.0.3 ; python_version >= '3.11' and python_version < '3.12'",
+ "pillow>=10.2.0",
+ "starlette-context>=0.3.6,<0.6",
+ "fastapi>=0.136.1,<0.137",
+ "psycopg[binary, pool]==3.1.18 ; python_version >= '3.11' and python_version < '3.13'",
+ "psycopg[binary, pool]>=3.2.2,<3.3.0 ; python_version >= '3.13' and python_version < '3.14'",
+ "alembic>=1.12.1,<2",
+ "PyJWT[crypto]>=2.12.0,<3",
+ "aioboto3>=14.3.0,<15",
+ "asyncache>=0.3.1,<0.4",
+ "types-boto3[full]>=1.38.31,<2",
+ "types-toml>=0.10.8.7,<0.11",
+ "filetype>=1.2.0,<2",
+ "fuzzysearch>=0.8,<1",
+ "aioredlock>=0.7.3,<0.8",
+ "tldextract>=5.1.2,<6",
+ "websockets>=12.0,<15.1",
+ "email-validator>=2.2.0,<3",
+ "requests-toolbelt>=1.0.0,<2",
+ "posthog>=3.7.0,<4",
+ "aiofiles>=24.1.0,<25",
+ "pyotp>=2.9.0,<3",
+ "asyncpg>=0.30.0,<0.32",
+ "json5>=0.13.0,<1",
+ "json-repair>=0.59.5,<0.60",
+ "pypdf>=6.7.5,<7",
+ "pdfplumber>=0.11.0,<0.12",
+ "fastmcp>=3.2.0,<4",
+ "psutil>=7.0.0",
+ "tiktoken>=0.9.0",
+ "anthropic>=0.97.0,<0.98",
+ "google-cloud-aiplatform>=1.149.0,<2",
+ "google-auth>=2.49.2,<3",
+ "google-auth-oauthlib>=1.3.1,<2",
+ "onepassword-sdk==0.4.0",
+ "lark>=1.2.2,<2",
+ "libcst>=1.8.2,<2",
+ "curlparser>=0.1.0,<0.2",
+ "pandas>=2.3.1,<4",
+ "azure-identity>=1.24.0,<2",
+ "azure-keyvault-secrets>=4.2.0,<5",
+ "jsonschema>=4.23.0",
+ "python-calamine>=0.6.1",
+ "python-docx>=1.1.0",
+ "urllib3>=2.7.0",
+ "zstandard>=0.25.0",
+ "sse-starlette>=3.4.1,<4",
+ "opentelemetry-api>=1.41.1,<2",
+ "croniter>=1.3.8,<4",
+ "authlib>=1.7.1",
+ "pyasn1>=0.6.3",
+ "tornado>=6.5.5",
+ "aiosqlite>=0.21.0,<0.23",
+]
[dependency-groups]
cloud = [
@@ -243,6 +323,9 @@ include = [
[tool.hatch.build.targets.wheel.force-include]
"alembic" = "alembic"
+[tool.uv.sources]
+skyvern-ui = { path = "packages/skyvern-ui" }
+
[tool.uv]
# Supply chain quarantine: block packages published less than 7 days ago.
# Override for urgent cases: uv add <pkg> --exclude-newer ""
diff --git a/scripts/build-skyvern-ui-package.sh b/scripts/build-skyvern-ui-package.sh
new file mode 100755
index 000000000..7c076ccb5
--- /dev/null
+++ b/scripts/build-skyvern-ui-package.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+FRONTEND_DIR="$ROOT_DIR/skyvern-frontend"
+PACKAGE_DIR="$ROOT_DIR/packages/skyvern-ui"
+PACKAGE_DIST_DIR="$PACKAGE_DIR/skyvern_ui/dist"
+OUT_DIR="${1:-$ROOT_DIR/dist}"
+
+cd "$FRONTEND_DIR"
+
+export VITE_API_BASE_URL="__VITE_API_BASE_URL_PLACEHOLDER__"
+export VITE_WSS_BASE_URL="__VITE_WSS_BASE_URL_PLACEHOLDER__"
+export VITE_ARTIFACT_API_BASE_URL="__VITE_ARTIFACT_API_BASE_URL_PLACEHOLDER__"
+export VITE_SKYVERN_API_KEY="__SKYVERN_API_KEY_PLACEHOLDER__"
+export VITE_BROWSER_STREAMING_MODE="__VITE_BROWSER_STREAMING_MODE_PLACEHOLDER__"
+
+npm ci
+npm run build
+
+rm -rf "$PACKAGE_DIST_DIR"
+mkdir -p "$PACKAGE_DIST_DIR"
+cp -R "$FRONTEND_DIR/dist/." "$PACKAGE_DIST_DIR/"
+
+cd "$ROOT_DIR"
+uv build "$PACKAGE_DIR" --out-dir "$OUT_DIR"
+
+python - "$OUT_DIR" "$PACKAGE_DIR" <<'PY'
+from pathlib import Path
+import sys
+import tomllib
+import zipfile
+
+out_dir = Path(sys.argv[1])
+package_dir = Path(sys.argv[2])
+version = tomllib.loads((package_dir / "pyproject.toml").read_text())["project"]["version"]
+wheel = out_dir / f"skyvern_ui-{version}-py3-none-any.whl"
+
+if not wheel.is_file():
+ raise SystemExit(f"No skyvern-ui wheel found at {wheel}")
+with zipfile.ZipFile(wheel) as archive:
+ names = set(archive.namelist())
+
+if "skyvern_ui/dist/index.html" not in names:
+ raise SystemExit(f"{wheel} is missing skyvern_ui/dist/index.html")
+if not any(name.startswith("skyvern_ui/dist/assets/") for name in names):
+ raise SystemExit(f"{wheel} is missing skyvern_ui/dist/assets")
+
+print(f"Verified prebuilt UI assets in {wheel}")
+PY
diff --git a/scripts/test-pip-ui-package.sh b/scripts/test-pip-ui-package.sh
new file mode 100755
index 000000000..6037ab5c9
--- /dev/null
+++ b/scripts/test-pip-ui-package.sh
@@ -0,0 +1,268 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+WHEELHOUSE="${1:-$(mktemp -d /tmp/skyvern-pip-ui-smoke.XXXXXX)}"
+PYTHON_IMAGE="${PYTHON_IMAGE:-python:3.11-slim}"
+
+mkdir -p "$WHEELHOUSE"
+
+cd "$ROOT_DIR"
+
+echo "Building skyvern-ui wheelhouse in $WHEELHOUSE"
+scripts/build-skyvern-ui-package.sh "$WHEELHOUSE"
+uv build --wheel --out-dir "$WHEELHOUSE"
+
+echo "Checking base skyvern install"
+docker run --rm -v "$WHEELHOUSE:/wheelhouse:ro" "$PYTHON_IMAGE" bash -s <<'BASH'
+set -euo pipefail
+export PIP_FIND_LINKS=/wheelhouse
+export PIP_PROGRESS_BAR=off
+export PIP_DISABLE_PIP_VERSION_CHECK=1
+python -m venv /venv
+. /venv/bin/activate
+python -m pip install -q --upgrade pip
+SKYVERN_WHEEL="$(ls /wheelhouse/skyvern-[0-9]*.whl | head -1)"
+python -m pip install -q "$SKYVERN_WHEEL"
+python - <<'PY'
+import importlib.util
+import os
+import subprocess
+import tempfile
+
+assert importlib.util.find_spec("skyvern_ui") is None
+assert importlib.util.find_spec("uvicorn") is None
+assert importlib.util.find_spec("starlette") is None
+
+result = subprocess.run(
+ ["skyvern", "run", "ui"],
+ cwd=tempfile.mkdtemp(),
+ env={**os.environ, "TERM": "dumb"},
+ text=True,
+ capture_output=True,
+ timeout=30,
+)
+output = result.stdout + result.stderr
+assert result.returncode == 0, output
+assert "Skyvern UI assets are not installed" in output
+assert 'pip install "skyvern[ui]"' in output
+
+result = subprocess.run(
+ ["skyvern", "run", "all"],
+ cwd=tempfile.mkdtemp(),
+ env={**os.environ, "TERM": "dumb"},
+ text=True,
+ capture_output=True,
+ timeout=30,
+)
+output = result.stdout + result.stderr
+assert result.returncode == 1, output
+assert '`skyvern run all` needs the local server dependencies' in output
+assert 'pip install "skyvern[all]"' in output
+print("BASE_SMOKE_OK")
+PY
+BASH
+
+echo "Checking skyvern[ui] install"
+docker run --rm -v "$WHEELHOUSE:/wheelhouse:ro" "$PYTHON_IMAGE" bash -s <<'BASH'
+set -euo pipefail
+export PIP_FIND_LINKS=/wheelhouse
+export PIP_PROGRESS_BAR=off
+export PIP_DISABLE_PIP_VERSION_CHECK=1
+python -m venv /venv
+. /venv/bin/activate
+python -m pip install -q --upgrade pip
+SKYVERN_WHEEL="$(ls /wheelhouse/skyvern-[0-9]*.whl | head -1)"
+python -m pip install -q "${SKYVERN_WHEEL}[ui]"
+python - <<'PY'
+import importlib.util
+import os
+import subprocess
+import tempfile
+from pathlib import Path
+
+from skyvern.cli import ui_runtime
+
+assert importlib.util.find_spec("skyvern_ui") is not None
+assert importlib.util.find_spec("uvicorn") is None
+assert importlib.util.find_spec("starlette") is None
+assert ui_runtime.installed_ui_dist_available() is True
+
+cache_dir = Path(tempfile.mkdtemp()) / "cache"
+os.environ[ui_runtime.UI_CACHE_ENV_VAR] = str(cache_dir)
+runtime = ui_runtime.prepare_installed_ui_dist(
+ ui_runtime.InstalledUiConfig(
+ api_base_url="http://example.test/api/v1",
+ wss_base_url="ws://example.test/api/v1",
+ artifact_api_base_url="http://example.test:9090",
+ skyvern_api_key="docker-key",
+ browser_streaming_mode="cdp",
+ )
+)
+contents = "\n".join(
+ path.read_text(errors="ignore")
+ for path in runtime.rglob("*")
+ if path.is_file() and path.suffix in {".html", ".js", ".css"}
+)
+assert "__VITE_API_BASE_URL_PLACEHOLDER__" not in contents
+assert "__SKYVERN_API_KEY_PLACEHOLDER__" not in contents
+assert "http://example.test/api/v1" in contents
+assert "docker-key" in contents
+
+try:
+ result = subprocess.run(
+ ["skyvern", "run", "ui"],
+ cwd=tempfile.mkdtemp(),
+ env={**os.environ, "TERM": "dumb", "SKYVERN_UI_CACHE_DIR": str(cache_dir / "serve")},
+ text=True,
+ capture_output=True,
+ timeout=5,
+ )
+ output = result.stdout + result.stderr
+except subprocess.TimeoutExpired as exc:
+ stdout = exc.stdout or ""
+ stderr = exc.stderr or ""
+ if isinstance(stdout, bytes):
+ stdout = stdout.decode(errors="ignore")
+ if isinstance(stderr, bytes):
+ stderr = stderr.decode(errors="ignore")
+ output = stdout + stderr
+assert "Starting packaged Skyvern UI" in output
+print("UI_EXTRA_SMOKE_OK")
+PY
+BASH
+
+echo "Checking skyvern[server] install"
+docker run --rm -v "$WHEELHOUSE:/wheelhouse:ro" "$PYTHON_IMAGE" bash -s <<'BASH'
+set -euo pipefail
+export PIP_FIND_LINKS=/wheelhouse
+export PIP_PROGRESS_BAR=off
+export PIP_DISABLE_PIP_VERSION_CHECK=1
+python -m venv /venv
+. /venv/bin/activate
+python -m pip install -q --upgrade pip
+SKYVERN_WHEEL="$(ls /wheelhouse/skyvern-[0-9]*.whl | head -1)"
+python -m pip install -q "${SKYVERN_WHEEL}[server]"
+python - <<'PY'
+import importlib.util
+import os
+import subprocess
+import tempfile
+
+assert importlib.util.find_spec("skyvern_ui") is None
+assert importlib.util.find_spec("uvicorn") is not None
+assert importlib.util.find_spec("starlette") is not None
+
+help_result = subprocess.run(["skyvern", "run", "server", "--help"], text=True, capture_output=True, timeout=30)
+assert help_result.returncode == 0, help_result.stderr
+
+result = subprocess.run(
+ ["skyvern", "run", "ui"],
+ cwd=tempfile.mkdtemp(),
+ env={**os.environ, "TERM": "dumb"},
+ text=True,
+ capture_output=True,
+ timeout=30,
+)
+output = result.stdout + result.stderr
+assert result.returncode == 0, output
+assert "Skyvern UI assets are not installed" in output
+print("SERVER_EXTRA_SMOKE_OK")
+PY
+BASH
+
+echo "Checking skyvern[all] install"
+docker run --rm -v "$WHEELHOUSE:/wheelhouse:ro" "$PYTHON_IMAGE" bash -s <<'BASH'
+set -euo pipefail
+export PIP_FIND_LINKS=/wheelhouse
+export PIP_PROGRESS_BAR=off
+export PIP_DISABLE_PIP_VERSION_CHECK=1
+python -m venv /venv
+. /venv/bin/activate
+python -m pip install -q --upgrade pip
+SKYVERN_WHEEL="$(ls /wheelhouse/skyvern-[0-9]*.whl | head -1)"
+python -m pip install -q "${SKYVERN_WHEEL}[all]"
+python - <<'PY'
+import importlib.util
+import os
+import subprocess
+import tempfile
+
+from skyvern.cli import ui_runtime
+
+assert importlib.util.find_spec("skyvern_ui") is not None
+assert importlib.util.find_spec("uvicorn") is not None
+assert importlib.util.find_spec("starlette") is not None
+assert ui_runtime.installed_ui_dist_available() is True
+
+help_result = subprocess.run(["skyvern", "run", "all", "--help"], text=True, capture_output=True, timeout=30)
+assert help_result.returncode == 0, help_result.stderr
+assert "--install-ui" in help_result.stdout
+
+try:
+ result = subprocess.run(
+ ["skyvern", "run", "ui"],
+ cwd=tempfile.mkdtemp(),
+ env={**os.environ, "TERM": "dumb", "SKYVERN_UI_CACHE_DIR": tempfile.mkdtemp()},
+ text=True,
+ capture_output=True,
+ timeout=5,
+ )
+ output = result.stdout + result.stderr
+except subprocess.TimeoutExpired as exc:
+ stdout = exc.stdout or ""
+ stderr = exc.stderr or ""
+ if isinstance(stdout, bytes):
+ stdout = stdout.decode(errors="ignore")
+ if isinstance(stderr, bytes):
+ stderr = stderr.decode(errors="ignore")
+ output = stdout + stderr
+assert "Starting packaged Skyvern UI" in output
+print("ALL_EXTRA_SMOKE_OK")
+PY
+BASH
+
+echo "Checking auto-install path"
+docker run --rm -v "$WHEELHOUSE:/wheelhouse:ro" "$PYTHON_IMAGE" bash -s <<'BASH'
+set -euo pipefail
+export PIP_FIND_LINKS=/wheelhouse
+export PIP_PROGRESS_BAR=off
+export PIP_DISABLE_PIP_VERSION_CHECK=1
+python -m venv /venv
+. /venv/bin/activate
+python -m pip install -q --upgrade pip
+SKYVERN_WHEEL="$(ls /wheelhouse/skyvern-[0-9]*.whl | head -1)"
+python -m pip install -q "$SKYVERN_WHEEL"
+python - <<'PY'
+import importlib.util
+import os
+import subprocess
+import tempfile
+
+assert importlib.util.find_spec("skyvern_ui") is None
+try:
+ result = subprocess.run(
+ ["skyvern", "run", "ui", "--install-ui"],
+ cwd=tempfile.mkdtemp(),
+ env={**os.environ, "TERM": "dumb", "PIP_FIND_LINKS": "/wheelhouse", "SKYVERN_UI_CACHE_DIR": tempfile.mkdtemp()},
+ text=True,
+ capture_output=True,
+ timeout=20,
+ )
+ output = result.stdout + result.stderr
+except subprocess.TimeoutExpired as exc:
+ stdout = exc.stdout or ""
+ stderr = exc.stderr or ""
+ if isinstance(stdout, bytes):
+ stdout = stdout.decode(errors="ignore")
+ if isinstance(stderr, bytes):
+ stderr = stderr.decode(errors="ignore")
+ output = stdout + stderr
+assert "Installing skyvern-ui==" in output
+assert "Packaged Skyvern UI assets installed" in output
+assert "Starting packaged Skyvern UI" in output
+print("AUTO_INSTALL_SMOKE_OK")
+PY
+BASH
+
+echo "All pip UI package smoke tests passed."
diff --git a/skyvern/cli/init_command.py b/skyvern/cli/init_command.py
index 5613cba2d..02c4e5ce5 100644
--- a/skyvern/cli/init_command.py
+++ b/skyvern/cli/init_command.py
@@ -216,7 +216,8 @@ _LOCAL_SERVER_DEPENDENCY_HINT = (
"Local Skyvern needs the server dependencies, but this Python environment is missing "
"[cyan]{module}[/cyan].\n\n"
"Run [cyan]{install_command}[/cyan] and then rerun [cyan]skyvern quickstart[/cyan].\n\n"
- "For the full UI + API + Postgres stack, clone the Skyvern repository and use Docker Compose."
+ 'For the local API + UI, use [cyan]pip install "skyvern[all]"[/cyan]. '
+ "For a full containerized Postgres stack, clone the Skyvern repository and use Docker Compose."
)
@@ -324,6 +325,26 @@ async def _setup_local_organization_from_database() -> str:
return await setup_local_organization_from_database_string(settings.DATABASE_STRING)
+def _use_default_sqlite_database(*, env_path: Path | str | None = None) -> None:
+ from skyvern.config import _default_database_string # noqa: PLC0415
+
+ database_url = _default_database_string()
+ console.print(
+ Panel(
+ "[bold cyan]SQLite Database Setup[/bold cyan]\n\n"
+ f"Using the default SQLite database at [cyan]{database_url}[/cyan].\n"
+ "To use Postgres instead, pass [cyan]--postgres[/cyan] to start a local container "
+ "or [cyan]--database-string[/cyan] for an existing database.",
+ border_style="blue",
+ )
+ )
+ capture_setup_event(
+ "database-skip",
+ success=True,
+ extra_data={"reason": "sqlite_default", "env_path": str(env_path) if env_path is not None else None},
+ )
+
+
@overload
def init_env(
no_postgres: bool = False,
@@ -413,6 +434,8 @@ def init_env(
console.print("🔗 [bold blue]Using custom database connection...[/bold blue]")
set_env_var("DATABASE_STRING", database_string)
console.print(f"✅ [green]Database connection string set in {backend_env_path}.[/green]")
+ elif no_postgres:
+ _use_default_sqlite_database(env_path=backend_env_path)
else:
setup_postgresql(no_postgres, env_path=backend_env_path)
console.print("📊 [bold blue]Running database migrations...[/bold blue]")
@@ -590,11 +613,12 @@ def init_app_factory() -> typer.Typer:
@app.callback()
def _init_callback(
ctx: typer.Context,
- no_postgres: bool = typer.Option(False, "--no-postgres", help="Skip starting PostgreSQL container"),
+ no_postgres: bool = typer.Option(False, "--no-postgres", help="Use default SQLite instead of PostgreSQL"),
+ postgres: bool = typer.Option(False, "--postgres", help="Start or reuse a local PostgreSQL container"),
database_string: str = typer.Option(
"",
"--database-string",
- help="Custom database connection string (e.g., postgresql+psycopg://user:password@host:port/dbname). When provided, skips Docker PostgreSQL setup.",
+ help="Custom database connection string (e.g., postgresql+psycopg://user:password@host:port/dbname).",
),
env_scope: str | None = typer.Option(
None,
@@ -604,7 +628,10 @@ def init_app_factory() -> typer.Typer:
) -> None:
"""Run full initialization when no subcommand is provided."""
if ctx.invoked_subcommand is None:
- init_env(no_postgres=no_postgres, database_string=database_string, env_scope=env_scope)
+ if postgres and no_postgres:
+ console.print("[bold red]Use only one of --postgres or --no-postgres.[/bold red]")
+ raise typer.Exit(1)
+ init_env(no_postgres=no_postgres or not postgres, database_string=database_string, env_scope=env_scope)
@app.command(name="browser")
def _init_browser_command() -> None:
diff --git a/skyvern/cli/quickstart.py b/skyvern/cli/quickstart.py
index 022d09587..6fb4fa74b 100644
--- a/skyvern/cli/quickstart.py
+++ b/skyvern/cli/quickstart.py
@@ -19,37 +19,40 @@ from rich.prompt import Confirm, Prompt
from rich.text import Text
from skyvern.cli.console import console
-from skyvern.utils.env_paths import EnvScope, parse_env_scope, resolve_frontend_env_path
+from skyvern.cli.ui_runtime import has_frontend_runtime
+from skyvern.utils.env_paths import EnvScope, parse_env_scope
quickstart_app = typer.Typer(help="Quickstart command to set up and run Skyvern with one command.")
_SKYVERN_COMPOSE_SERVICES = {"postgres", "skyvern", "skyvern-ui"}
-def _server_extra_install_target() -> str:
+def _server_extra_install_target(*, include_ui: bool = True) -> str:
cwd = Path.cwd()
if (cwd / "pyproject.toml").is_file() and (cwd / "skyvern").is_dir():
return ".[server]"
+ extra = "all" if include_ui else "server"
try:
version = importlib.metadata.version("skyvern")
except importlib.metadata.PackageNotFoundError:
- return "skyvern[server]"
- return f"skyvern[server]=={version}"
+ return f"skyvern[{extra}]"
+ return f"skyvern[{extra}]=={version}"
-def _install_server_extra_for_quickstart(*, assume_yes: bool = False) -> bool:
- target = _server_extra_install_target()
+def _install_server_extra_for_quickstart(*, include_ui: bool = True, assume_yes: bool = False) -> bool:
+ target = _server_extra_install_target(include_ui=include_ui)
+ dependency_description = "server dependencies and packaged UI" if include_ui else "server dependencies"
console.print(
Panel(
- "Local quickstart needs the server dependencies.\n\n"
+ f"Local quickstart needs the {dependency_description}.\n\n"
f"Install [cyan]{escape(target)}[/cyan] into the current Python environment now?",
title="Missing Local Server Dependency",
border_style="yellow",
)
)
if not assume_yes and not Confirm.ask("Install the missing server dependencies now?", default=True):
- _print_server_guidance()
+ _print_server_guidance(include_ui=include_ui)
return False
console.print(f"📦 [bold blue]Installing {escape(target)}...[/bold blue]")
@@ -60,7 +63,7 @@ def _install_server_extra_for_quickstart(*, assume_yes: bool = False) -> bool:
)
except subprocess.CalledProcessError as install_error:
console.print(f"[bold red]Failed to install {target}: {install_error}[/bold red]")
- _print_server_guidance()
+ _print_server_guidance(include_ui=include_ui)
return False
importlib.invalidate_caches()
@@ -162,7 +165,7 @@ def _print_quickstart_selector(
has_server_extra: bool,
) -> None:
local_status = "installed" if has_local_extra else 'requires `pip install "skyvern[local]"`'
- server_status = "installed" if has_server_extra else 'requires `pip install "skyvern[server]"`'
+ server_status = "installed" if has_server_extra else 'requires `pip install "skyvern[all]"`'
message = f"""Choose how you want to use Skyvern:
1. Cloud/API SDK usage
@@ -171,7 +174,7 @@ def _print_quickstart_selector(
2. Embedded local Python SDK via skyvern[local]
Status: {local_status}
-3. Self-hosted local server via skyvern[server]
+3. Self-hosted local server + web UI via skyvern[all]
Status: {server_status}
Default: {default_path.value}
@@ -218,17 +221,19 @@ def _select_quickstart_path(
def _server_quickstart_flags_requested(
*,
no_postgres: bool,
+ postgres: bool,
database_string: str,
skip_browser_install: bool,
server_only: bool,
) -> bool:
"""Return whether the user supplied options for the Python server setup path."""
- return no_postgres or bool(database_string) or skip_browser_install or server_only
+ return no_postgres or postgres or bool(database_string) or skip_browser_install or server_only
def _server_quickstart_options(
*,
no_postgres: bool,
+ postgres: bool,
database_string: str,
skip_browser_install: bool,
server_only: bool,
@@ -242,6 +247,7 @@ def _server_quickstart_options(
) -> dict[str, Any]:
options: dict[str, Any] = {
"no_postgres": no_postgres,
+ "postgres": postgres,
"database_string": database_string,
"skip_browser_install": skip_browser_install,
"server_only": server_only,
@@ -300,14 +306,19 @@ This path does not require Postgres, Docker, migrations, or `skyvern run server`
console.print(Panel(Text(message), title="Embedded Local SDK", border_style="cyan"))
-def _print_server_guidance() -> None:
- message = """Self-hosted local server
+def _print_server_guidance(*, include_ui: bool = True) -> None:
+ install_command = 'pip install "skyvern[all]"' if include_ui else 'pip install "skyvern[server]"'
+ setup_description = "local server, packaged UI, SQLite database, local API key, and MCP"
+ if not include_ui:
+ setup_description = "local server, SQLite database, local API key, and MCP"
+ message = f"""Self-hosted local server
-Install: pip install "skyvern[server]"
+Install: {install_command}
Next: python -m skyvern quickstart
-This path sets up the local server, database, local API key, and MCP.
-Wheel installs run the backend only; use a source checkout or Docker Compose for the local UI.
+This path sets up the {setup_description}.
+Use --postgres or --database-string if you want Postgres instead of SQLite.
+Use a source checkout / Docker Compose when you need frontend development mode.
"""
console.print(Panel(Text(message), title="Self-Hosted Server", border_style="cyan"))
@@ -327,6 +338,7 @@ def _run_server_quickstart(
database_string: str,
skip_browser_install: bool,
server_only: bool,
+ postgres: bool = False,
skip_llm_setup: bool = False,
configure_mcp: bool | None = None,
browser_type: Literal["chromium-headful", "chromium-headless", "cdp-connect"] | None = None,
@@ -342,7 +354,7 @@ def _run_server_quickstart(
# Initialize Skyvern (pip install path)
console.print("\n[bold blue]Initializing Skyvern...[/bold blue]")
init_result = init_env(
- no_postgres=no_postgres,
+ no_postgres=no_postgres or (not postgres and not database_string),
database_string=database_string,
skip_browser_install=skip_browser_install,
mode="local",
@@ -386,9 +398,7 @@ def _run_server_quickstart(
console.print("\n[bold blue]Starting Skyvern services...[/bold blue]")
asyncio.run(start_services(server_only=server_only))
else:
- start_command = (
- "skyvern run server" if server_only or resolve_frontend_env_path() is None else "skyvern run all"
- )
+ start_command = "skyvern run server" if server_only or not has_frontend_runtime() else "skyvern run all"
console.print(
f"\n[yellow]Skipping service startup. You can start services later with '{start_command}'[/yellow]"
)
@@ -763,11 +773,12 @@ def run_docker_compose_setup() -> None:
@quickstart_app.callback(invoke_without_command=True)
def quickstart(
ctx: typer.Context,
- no_postgres: bool = typer.Option(False, "--no-postgres", help="Skip starting PostgreSQL container"),
+ no_postgres: bool = typer.Option(False, "--no-postgres", help="Use default SQLite instead of PostgreSQL"),
+ postgres: bool = typer.Option(False, "--postgres", help="Start or reuse a local PostgreSQL container"),
database_string: str = typer.Option(
"",
"--database-string",
- help="Custom database connection string (e.g., postgresql+psycopg://user:password@host:port/dbname). When provided, skips Docker PostgreSQL setup.",
+ help="Custom database connection string (e.g., postgresql+psycopg://user:password@host:port/dbname).",
),
skip_browser_install: bool = typer.Option(
False, "--skip-browser-install", help="Skip Chromium browser installation"
@@ -858,11 +869,22 @@ def quickstart(
)
)
+ if postgres and no_postgres:
+ console.print(
+ Panel(
+ "[bold red]Conflicting quickstart options.[/bold red]\n"
+ "Use only one of [cyan]--postgres[/cyan] or [cyan]--no-postgres[/cyan].",
+ border_style="red",
+ )
+ )
+ raise typer.Exit(1)
+
has_server_extra = _has_server_quickstart_extra()
# The server extra is a superset of the local embedded runtime dependencies.
has_local_extra = has_server_extra or _has_local_quickstart_extra()
server_flags_requested = _server_quickstart_flags_requested(
no_postgres=no_postgres,
+ postgres=postgres,
database_string=database_string,
skip_browser_install=skip_browser_install,
server_only=server_only,
@@ -958,7 +980,7 @@ def quickstart(
console.print("\n[bold blue]Setup Method[/bold blue]")
console.print("Docker Compose file detected. Choose your setup method:\n")
console.print(" [cyan]1.[/cyan] [green]Docker Compose (Recommended)[/green] - Full containerized setup")
- console.print(" [cyan]2.[/cyan] pip install - Local Python setup with Docker for PostgreSQL only\n")
+ console.print(" [cyan]2.[/cyan] pip install - Local Python setup with SQLite by default\n")
use_docker_compose = Confirm.ask(
"Would you like to use Docker Compose for the full setup?",
@@ -971,14 +993,22 @@ def quickstart(
if not _has_server_quickstart_extra():
if not yes and not _is_interactive_input():
- _print_server_guidance()
+ _print_server_guidance(include_ui=not server_only)
raise typer.Exit(0)
- if not _install_server_extra_for_quickstart(assume_yes=yes) or not _has_server_quickstart_extra():
+ if (
+ not _install_server_extra_for_quickstart(include_ui=not server_only, assume_yes=yes)
+ or not _has_server_quickstart_extra()
+ ):
raise typer.Exit(1)
+ elif not server_only and not has_frontend_runtime() and _is_interactive_input():
+ from skyvern.cli.run_commands import _install_packaged_ui_if_requested # noqa: PLC0415
+
+ _install_packaged_ui_if_requested()
_run_server_quickstart(
**_server_quickstart_options(
no_postgres=no_postgres,
+ postgres=postgres,
database_string=database_string,
skip_browser_install=skip_browser_install,
server_only=server_only,
diff --git a/skyvern/cli/run_commands.py b/skyvern/cli/run_commands.py
index 0c0defc0f..b9d32dd66 100644
--- a/skyvern/cli/run_commands.py
+++ b/skyvern/cli/run_commands.py
@@ -1,40 +1,55 @@
import asyncio
import atexit
+import importlib
+import importlib.metadata
+import importlib.util
import json
import logging
import os
+import secrets
+import shlex
import shutil
import subprocess
import sys
+import urllib.parse
from typing import TYPE_CHECKING, Annotated, List, Literal, Optional
if TYPE_CHECKING:
from starlette.types import ASGIApp, Receive, Scope, Send
-import psutil
import typer
-import uvicorn
from dotenv import set_key
+from rich.markup import escape
from rich.panel import Panel
from rich.prompt import Confirm
-from starlette.middleware import Middleware
-from starlette.responses import JSONResponse as StarletteJSONResponse
-from starlette.responses import Response as StarletteResponse
from skyvern._cli_bootstrap import prepare_cli_runtime
from skyvern.cli.commands._output import output_error
from skyvern.cli.commands._tty import is_interactive
from skyvern.cli.console import console
from skyvern.cli.core.result import set_concise_responses
+from skyvern.cli.ui_runtime import (
+ ARTIFACT_PORT,
+ UI_PACKAGE_NAME,
+ UI_PORT,
+ InstalledUiConfig,
+ artifact_api_base_url_with_token,
+ has_frontend_runtime,
+ installed_ui_dist_available,
+ prepare_installed_ui_dist,
+ serve_installed_ui,
+)
from skyvern.utils import detect_os
from skyvern.utils.env_paths import (
EnvIntent,
+ load_backend_env_files,
resolve_backend_env_path,
resolve_frontend_env_path,
)
run_app = typer.Typer(help="Commands to run Skyvern services such as the API server or UI.")
_mcp_cleanup_done = False
+_LOGGER = logging.getLogger(__name__)
def _default_host() -> str:
@@ -88,6 +103,8 @@ def get_pids_on_port(port: int) -> List[int]:
"""Return a list of PIDs listening on the given port."""
pids = []
try:
+ import psutil # noqa: PLC0415
+
for conn in psutil.net_connections(kind="inet"):
if conn.laddr and conn.laddr.port == port and conn.pid:
pids.append(conn.pid)
@@ -119,6 +136,8 @@ def run_server() -> None:
_handle_missing_dep(exc)
+ import uvicorn # noqa: PLC0415
+
prepare_cli_runtime(intent=EnvIntent.SERVER)
from skyvern.config import settings # noqa: PLC0415
@@ -169,23 +188,271 @@ def _handle_port_conflict(port: int, *, force: bool, command_hint: str) -> bool:
return True
+def _websocket_base_url_for_api_base_url(api_base_url: str) -> str:
+ parsed = urllib.parse.urlparse(api_base_url)
+ if parsed.scheme == "https":
+ return urllib.parse.urlunparse(parsed._replace(scheme="wss"))
+ if parsed.scheme == "http":
+ return urllib.parse.urlunparse(parsed._replace(scheme="ws"))
+ return api_base_url
+
+
+def _installed_ui_config(
+ *,
+ api_base_url: str | None = None,
+ wss_base_url: str | None = None,
+ artifact_api_base_url: str | None = None,
+ skyvern_api_key: str | None = None,
+ browser_streaming_mode: str | None = None,
+) -> InstalledUiConfig:
+ backend_env_path = resolve_backend_env_path(intent=EnvIntent.SERVER)
+ if backend_env_path.exists():
+ load_backend_env_files(intent=EnvIntent.SERVER)
+ else:
+ console.print(f"[yellow]Backend .env file not found at {backend_env_path}; using UI defaults.[/yellow]")
+
+ api_port = os.getenv("PORT", "8000")
+ resolved_api_base_url = (
+ api_base_url
+ if api_base_url is not None
+ else os.getenv("VITE_API_BASE_URL", f"http://localhost:{api_port}/api/v1")
+ )
+ resolved_wss_base_url = (
+ wss_base_url
+ if wss_base_url is not None
+ else os.getenv("VITE_WSS_BASE_URL") or _websocket_base_url_for_api_base_url(resolved_api_base_url)
+ )
+ resolved_artifact_api_base_url = (
+ artifact_api_base_url
+ if artifact_api_base_url is not None
+ else os.getenv("VITE_ARTIFACT_API_BASE_URL", f"http://localhost:{ARTIFACT_PORT}")
+ )
+ resolved_skyvern_api_key = (
+ skyvern_api_key
+ if skyvern_api_key is not None
+ else os.getenv("VITE_SKYVERN_API_KEY", os.getenv("SKYVERN_API_KEY", ""))
+ )
+ resolved_browser_streaming_mode = (
+ browser_streaming_mode
+ if browser_streaming_mode is not None
+ else os.getenv("VITE_BROWSER_STREAMING_MODE", os.getenv("BROWSER_STREAMING_MODE", "vnc"))
+ )
+ return InstalledUiConfig(
+ api_base_url=resolved_api_base_url,
+ wss_base_url=resolved_wss_base_url,
+ artifact_api_base_url=resolved_artifact_api_base_url,
+ skyvern_api_key=resolved_skyvern_api_key,
+ browser_streaming_mode=resolved_browser_streaming_mode,
+ )
+
+
+def _ui_install_target() -> str:
+ try:
+ skyvern_version = importlib.metadata.version("skyvern")
+ except importlib.metadata.PackageNotFoundError:
+ return UI_PACKAGE_NAME
+ return f"{UI_PACKAGE_NAME}=={skyvern_version}"
+
+
+def _ui_install_command(install_target: str) -> list[str]:
+ uv_bin = shutil.which("uv")
+ if uv_bin and (os.getenv("VIRTUAL_ENV") or os.getenv("UV_PROJECT_ENVIRONMENT")):
+ return [uv_bin, "pip", "install", install_target]
+ return [sys.executable, "-m", "pip", "install", install_target]
+
+
+def _format_command(command: list[str]) -> str:
+ return " ".join(shlex.quote(part) for part in command)
+
+
+def _print_missing_ui_assets() -> None:
+ ui_install_command = escape('pip install "skyvern[ui]"')
+ all_install_command = escape('pip install "skyvern[all]"')
+ console.print(
+ Panel(
+ "[bold red]ERROR: Skyvern UI assets are not installed.[/bold red]\n\n"
+ f"Run [cyan]{ui_install_command}[/cyan] for the packaged UI, "
+ f"or [cyan]{all_install_command}[/cyan] for local server + UI.\n\n"
+ "For frontend development, run this command from a Skyvern source checkout.",
+ border_style="red",
+ )
+ )
+
+
+def _install_packaged_ui_if_requested(*, assume_yes: bool = False) -> bool:
+ install_target = _ui_install_target()
+ if not assume_yes:
+ if not is_interactive():
+ install_command = _format_command(_ui_install_command(install_target))
+ _LOGGER.warning(
+ "packaged_ui_install_skipped_non_interactive",
+ extra={"install_target": install_target, "install_command": install_command},
+ )
+ console.print(
+ Panel(
+ "[yellow]Packaged Skyvern UI assets are not installed and this shell is "
+ "non-interactive.[/yellow]\n\n"
+ f"Automatic install was skipped. Run [cyan]{escape(install_command)}[/cyan] "
+ "or pass [cyan]--install-ui[/cyan] when you want the CLI to install them.",
+ title="UI install skipped",
+ border_style="yellow",
+ )
+ )
+ return False
+ if not Confirm.ask(f"Install packaged Skyvern UI assets now ({install_target})?", default=True):
+ return False
+
+ console.print(f"📦 [bold blue]Installing {install_target}...[/bold blue]")
+ result = subprocess.run(_ui_install_command(install_target), check=False)
+ if result.returncode != 0:
+ console.print(f"[bold red]Failed to install {install_target}.[/bold red]")
+ return False
+
+ importlib.invalidate_caches()
+ if installed_ui_dist_available():
+ console.print("✅ [green]Packaged Skyvern UI assets installed.[/green]")
+ return True
+
+ console.print(f"[bold red]Installed {install_target}, but packaged UI assets were not found.[/bold red]")
+ return False
+
+
+def _missing_run_all_dependencies() -> list[str]:
+ required_modules = ["uvicorn", "sqlalchemy", "alembic"]
+ return [module for module in required_modules if importlib.util.find_spec(module) is None]
+
+
+def _print_missing_run_all_dependencies(missing_modules: list[str]) -> None:
+ all_install_command = escape('pip install "skyvern[all]"')
+ ui_install_command = escape("skyvern run ui --install-ui")
+ missing = ", ".join(missing_modules)
+ console.print(
+ Panel(
+ "[bold red]ERROR: `skyvern run all` needs the local server dependencies.[/bold red]\n\n"
+ f"Missing: [yellow]{missing}[/yellow]\n"
+ f"Run [cyan]{all_install_command}[/cyan] to install the local server and packaged UI together.\n\n"
+ f"If you only want the packaged UI, run [cyan]{ui_install_command}[/cyan].",
+ border_style="red",
+ )
+ )
+
+
+def _run_installed_ui(
+ *,
+ force: bool,
+ api_base_url: str | None = None,
+ wss_base_url: str | None = None,
+ artifact_api_base_url: str | None = None,
+ skyvern_api_key: str | None = None,
+ browser_streaming_mode: str | None = None,
+) -> None:
+ if not _handle_port_conflict(ARTIFACT_PORT, force=force, command_hint="skyvern stop ui"):
+ return
+
+ artifact_token = secrets.token_urlsafe(24)
+ config = _installed_ui_config(
+ api_base_url=api_base_url,
+ wss_base_url=wss_base_url,
+ artifact_api_base_url=artifact_api_base_url,
+ skyvern_api_key=skyvern_api_key,
+ browser_streaming_mode=browser_streaming_mode,
+ )
+ config = InstalledUiConfig(
+ api_base_url=config.api_base_url,
+ wss_base_url=config.wss_base_url,
+ artifact_api_base_url=artifact_api_base_url_with_token(config.artifact_api_base_url, artifact_token),
+ skyvern_api_key=config.skyvern_api_key,
+ browser_streaming_mode=config.browser_streaming_mode,
+ )
+ dist_dir = prepare_installed_ui_dist(config)
+ console.print(
+ Panel(
+ "[bold green]Starting packaged Skyvern UI...[/bold green]\n\n"
+ f"UI: [cyan]http://localhost:{UI_PORT}[/cyan]\n"
+ f"Artifact server: [cyan]http://localhost:{ARTIFACT_PORT}[/cyan]",
+ border_style="green",
+ )
+ )
+ serve_installed_ui(dist_dir, ui_port=UI_PORT, artifact_port=ARTIFACT_PORT, artifact_token=artifact_token)
+
+
+def _apply_frontend_env_overrides(
+ frontend_env_path: os.PathLike[str] | str,
+ *,
+ api_base_url: str | None,
+ wss_base_url: str | None,
+ artifact_api_base_url: str | None,
+ skyvern_api_key: str | None,
+ browser_streaming_mode: str | None,
+) -> None:
+ overrides = {
+ "VITE_API_BASE_URL": api_base_url,
+ "VITE_WSS_BASE_URL": wss_base_url,
+ "VITE_ARTIFACT_API_BASE_URL": artifact_api_base_url,
+ "VITE_SKYVERN_API_KEY": skyvern_api_key,
+ "VITE_BROWSER_STREAMING_MODE": browser_streaming_mode,
+ }
+ for key, value in overrides.items():
+ if value is not None:
+ set_key(frontend_env_path, key, value)
+
+
@run_app.command(name="ui")
def run_ui(
- force: bool = typer.Option(False, "--force", help="Kill existing process on port 8080 without prompting."),
+ force: Annotated[
+ bool, typer.Option("--force", help="Kill existing process on port 8080 without prompting.")
+ ] = False,
+ install_ui: Annotated[
+ bool, typer.Option("--install-ui", help="Install packaged UI assets if they are missing.")
+ ] = False,
+ api_url: Annotated[
+ Optional[str],
+ typer.Option("--api-url", help="API base URL for the UI, e.g. https://api.skyvern.com/api/v1."),
+ ] = None,
+ wss_url: Annotated[
+ Optional[str],
+ typer.Option("--wss-url", help="WebSocket API base URL. Defaults to --api-url with ws/wss scheme."),
+ ] = None,
+ artifact_api_url: Annotated[
+ Optional[str],
+ typer.Option("--artifact-api-url", help="Artifact API base URL for local artifact rendering."),
+ ] = None,
+ api_key: Annotated[
+ Optional[str],
+ typer.Option("--api-key", help="Skyvern API key to inject into the UI runtime."),
+ ] = None,
+ browser_streaming_mode: Annotated[
+ Optional[str],
+ typer.Option("--browser-streaming-mode", help="Browser streaming mode for the UI, e.g. vnc or cdp."),
+ ] = None,
) -> None:
"""Run the Skyvern UI server.
Examples:
skyvern run ui
skyvern run ui --force
+ skyvern run ui --install-ui
+ skyvern run ui --api-url https://api.skyvern.com/api/v1 --api-key sk-...
"""
console.print(Panel("[bold blue]Starting Skyvern UI Server...[/bold blue]", border_style="blue"))
- if not _handle_port_conflict(8080, force=force, command_hint="skyvern run ui --force"):
- return
-
frontend_env_path = resolve_frontend_env_path()
if frontend_env_path is None:
- console.print("[bold red]ERROR: Skyvern Frontend directory not found.[/bold red]")
+ if not installed_ui_dist_available() and not _install_packaged_ui_if_requested(assume_yes=install_ui):
+ _print_missing_ui_assets()
+ return
+ if not _handle_port_conflict(UI_PORT, force=force, command_hint="skyvern run ui --force"):
+ return
+ _run_installed_ui(
+ force=force,
+ api_base_url=api_url,
+ wss_base_url=wss_url,
+ artifact_api_base_url=artifact_api_url,
+ skyvern_api_key=api_key,
+ browser_streaming_mode=browser_streaming_mode,
+ )
+ return
+
+ if not _handle_port_conflict(UI_PORT, force=force, command_hint="skyvern run ui --force"):
return
frontend_dir = frontend_env_path.parent
@@ -205,6 +472,15 @@ def run_ui(
else:
console.print(f"[red]ERROR: Backend .env file not found at {backend_env_path}[/red]")
+ _apply_frontend_env_overrides(
+ frontend_env_path,
+ api_base_url=api_url,
+ wss_base_url=wss_url,
+ artifact_api_base_url=artifact_api_url,
+ skyvern_api_key=api_key,
+ browser_streaming_mode=browser_streaming_mode,
+ )
+
os.chdir(frontend_dir)
try:
@@ -329,10 +605,23 @@ def run_docker() -> None:
@run_app.command(name="all")
-def run_all() -> None:
+def run_all(
+ install_ui: Annotated[
+ bool, typer.Option("--install-ui", help="Install packaged UI assets if they are missing.")
+ ] = False,
+) -> None:
"""Run the Skyvern API server and UI server in parallel."""
+ missing_dependencies = _missing_run_all_dependencies()
+ if missing_dependencies:
+ _print_missing_run_all_dependencies(missing_dependencies)
+ raise typer.Exit(1)
+
from skyvern.cli.utils import start_services # noqa: PLC0415
+ if not has_frontend_runtime():
+ installed = _install_packaged_ui_if_requested(assume_yes=install_ui)
+ if install_ui and not installed:
+ raise typer.Exit(1)
asyncio.run(start_services())
@@ -403,6 +692,9 @@ class _ServerCardMiddleware:
self.card = build_server_card(self.transport_type, endpoint_url)
async def __call__(self, scope: "Scope", receive: "Receive", send: "Send") -> None:
+ from starlette.responses import JSONResponse as StarletteJSONResponse # noqa: PLC0415
+ from starlette.responses import Response as StarletteResponse # noqa: PLC0415
+
if scope["type"] == "http" and scope["path"] == "/.well-known/mcp/server-card.json":
cors_headers = {
"Access-Control-Allow-Origin": "*",
@@ -450,6 +742,8 @@ def run_mcp(
) -> None:
"""Run the MCP server with configurable transport for local or remote hosting."""
prepare_cli_runtime(intent=EnvIntent.CLOUD)
+ from starlette.middleware import Middleware # noqa: PLC0415
+
from skyvern.cli.core.mcp_http_auth import MCPAPIKeyMiddleware # noqa: PLC0415
from skyvern.cli.core.session_manager import set_stateless_http_mode # noqa: PLC0415
from skyvern.cli.mcp_tools import mcp # noqa: PLC0415
diff --git a/skyvern/cli/ui_runtime.py b/skyvern/cli/ui_runtime.py
new file mode 100644
index 000000000..a8ccf6561
--- /dev/null
+++ b/skyvern/cli/ui_runtime.py
@@ -0,0 +1,453 @@
+from __future__ import annotations
+
+import json
+import os
+import posixpath
+import re
+import shutil
+import threading
+import urllib.parse
+import webbrowser
+from dataclasses import dataclass
+from http import HTTPStatus
+from http.server import BaseHTTPRequestHandler, SimpleHTTPRequestHandler, ThreadingHTTPServer
+from importlib import metadata, resources
+from importlib.resources.abc import Traversable
+from pathlib import Path
+from typing import Any
+
+from skyvern.utils.env_paths import resolve_frontend_env_path
+
+UI_PORT = 8080
+ARTIFACT_PORT = 9090
+UI_PACKAGE_NAME = "skyvern-ui"
+UI_PACKAGE_MODULE = "skyvern_ui"
+UI_CACHE_ENV_VAR = "SKYVERN_UI_CACHE_DIR"
+ARTIFACT_PATH_ROOTS_ENV_VAR = "SKYVERN_ARTIFACT_PATH_ROOTS"
+UI_BIND_HOST = "127.0.0.1"
+_IMAGE_CONTENT_TYPES = {
+ ".avif": "image/avif",
+ ".gif": "image/gif",
+ ".jpg": "image/jpeg",
+ ".jpeg": "image/jpeg",
+ ".png": "image/png",
+ ".svg": "image/svg+xml",
+ ".webp": "image/webp",
+}
+_PRIVATE_DIR_MODE = 0o700
+_PRIVATE_FILE_MODE = 0o600
+
+
+@dataclass(frozen=True)
+class InstalledUiConfig:
+ api_base_url: str
+ wss_base_url: str
+ artifact_api_base_url: str
+ skyvern_api_key: str
+ browser_streaming_mode: str
+
+
+def installed_ui_dist() -> Traversable | None:
+ """Return the installed prebuilt UI dist resource, if skyvern-ui is installed."""
+ try:
+ dist = resources.files(UI_PACKAGE_MODULE).joinpath("dist")
+ except ModuleNotFoundError:
+ return None
+
+ if not dist.is_dir() or not dist.joinpath("index.html").is_file():
+ return None
+ return dist
+
+
+def installed_ui_dist_available() -> bool:
+ return installed_ui_dist() is not None
+
+
+def has_frontend_runtime() -> bool:
+ """Return whether `skyvern run ui` can start either source or packaged UI."""
+ return resolve_frontend_env_path() is not None or installed_ui_dist_available()
+
+
+def installed_ui_version() -> str:
+ try:
+ module = __import__(UI_PACKAGE_MODULE)
+ return str(getattr(module, "__version__"))
+ except (AttributeError, ModuleNotFoundError):
+ pass
+ try:
+ return metadata.version(UI_PACKAGE_NAME)
+ except metadata.PackageNotFoundError:
+ return "unknown"
+
+
+def _ensure_private_dir(path: Path) -> None:
+ path.mkdir(parents=True, exist_ok=True, mode=_PRIVATE_DIR_MODE)
+ path.chmod(_PRIVATE_DIR_MODE)
+
+
+def _copy_resource_tree(source: Traversable, destination: Path) -> None:
+ _ensure_private_dir(destination)
+ for child in source.iterdir():
+ child_destination = destination / child.name
+ if child.is_dir():
+ _copy_resource_tree(child, child_destination)
+ else:
+ _ensure_private_dir(child_destination.parent)
+ child_destination.write_bytes(child.read_bytes())
+ child_destination.chmod(_PRIVATE_FILE_MODE)
+
+
+def _ui_cache_root() -> Path:
+ configured = os.getenv(UI_CACHE_ENV_VAR)
+ if configured:
+ return Path(configured).expanduser()
+ return Path.home() / ".cache" / "skyvern" / "ui"
+
+
+def _replace_placeholders(dist_dir: Path, replacements: dict[str, str]) -> None:
+ for asset in dist_dir.rglob("*"):
+ if not asset.is_file() or asset.suffix not in {".html", ".js", ".css"}:
+ continue
+ try:
+ contents = asset.read_text(encoding="utf-8")
+ except UnicodeDecodeError:
+ continue
+ updated = contents
+ for placeholder, value in replacements.items():
+ updated = updated.replace(placeholder, value)
+ if updated != contents:
+ asset.write_text(updated, encoding="utf-8")
+ asset.chmod(_PRIVATE_FILE_MODE)
+
+
+def prepare_installed_ui_dist(config: InstalledUiConfig) -> Path:
+ """Copy installed UI assets to a writable cache and inject runtime values."""
+ source_dist = installed_ui_dist()
+ if source_dist is None:
+ raise FileNotFoundError('Prebuilt Skyvern UI assets are not installed. Run `pip install "skyvern[ui]"`.')
+
+ cache_root = _ui_cache_root()
+ version_cache_dir = cache_root / installed_ui_version()
+ _ensure_private_dir(cache_root)
+ _ensure_private_dir(version_cache_dir)
+
+ runtime_dist = version_cache_dir / "runtime"
+ if runtime_dist.exists():
+ shutil.rmtree(runtime_dist)
+ _copy_resource_tree(source_dist, runtime_dist)
+ _replace_placeholders(
+ runtime_dist,
+ {
+ "__VITE_API_BASE_URL_PLACEHOLDER__": config.api_base_url,
+ "__VITE_WSS_BASE_URL_PLACEHOLDER__": config.wss_base_url,
+ "__VITE_ARTIFACT_API_BASE_URL_PLACEHOLDER__": config.artifact_api_base_url,
+ "__SKYVERN_API_KEY_PLACEHOLDER__": config.skyvern_api_key,
+ "__VITE_BROWSER_STREAMING_MODE_PLACEHOLDER__": config.browser_streaming_mode,
+ },
+ )
+ return runtime_dist
+
+
+def artifact_api_base_url_with_token(base_url: str, token: str) -> str:
+ return f"{base_url.rstrip('/')}/{token}"
+
+
+def _candidate_artifact_roots() -> list[Path]:
+ configured_roots = os.getenv(ARTIFACT_PATH_ROOTS_ENV_VAR)
+ if configured_roots:
+ return [Path(raw).expanduser() for raw in configured_roots.split(os.pathsep) if raw]
+
+ roots: list[Path] = []
+ for env_var in ("ARTIFACT_STORAGE_PATH", "TEMP_PATH"):
+ configured = os.getenv(env_var)
+ if configured:
+ roots.append(Path(configured).expanduser())
+
+ skyvern_settings: Any | None
+ try:
+ from skyvern.config import settings as skyvern_settings # noqa: PLC0415
+ except Exception:
+ skyvern_settings = None
+ if skyvern_settings is not None:
+ roots.extend(
+ [
+ Path(skyvern_settings.ARTIFACT_STORAGE_PATH).expanduser(),
+ Path(skyvern_settings.TEMP_PATH).expanduser(),
+ ]
+ )
+
+ roots.extend(
+ [
+ Path.cwd() / "artifacts",
+ Path.cwd() / "temp",
+ Path.home() / ".skyvern" / "artifacts",
+ Path.home() / ".skyvern" / "temp",
+ ]
+ )
+ return roots
+
+
+def _configured_artifact_roots() -> tuple[Path, ...]:
+ roots: list[Path] = []
+ seen: set[Path] = set()
+ for root in _candidate_artifact_roots():
+ resolved = root.resolve(strict=False)
+ if resolved in seen:
+ continue
+ roots.append(resolved)
+ seen.add(resolved)
+ return tuple(roots)
+
+
+def _should_serve_spa_index(request_path: str) -> bool:
+ if request_path in {"", "/"}:
+ return False
+ return posixpath.splitext(request_path.rstrip("/"))[1] == ""
+
+
+def _validate_tcp_port(port: int) -> int:
+ if isinstance(port, bool) or not isinstance(port, int) or port <= 0 or port > 65535:
+ raise ValueError(f"Invalid TCP port: {port!r}")
+ return port
+
+
+def _local_ui_origins(ui_port: int) -> tuple[str, str]:
+ port = _validate_tcp_port(ui_port)
+ return (f"http://localhost:{port}", f"http://127.0.0.1:{port}")
+
+
+def _normalize_artifact_path(raw_path: str) -> str | None:
+ if "\x00" in raw_path or "\r" in raw_path or "\n" in raw_path:
+ return None
+ if urllib.parse.urlparse(raw_path).scheme.lower() == "file":
+ return None
+ return os.path.realpath(os.path.expanduser(raw_path))
+
+
+def _image_content_type(path: str) -> str:
+ return _IMAGE_CONTENT_TYPES.get(os.path.splitext(path)[1].lower(), "application/octet-stream")
+
+
+class _ReusableThreadingHTTPServer(ThreadingHTTPServer):
+ allow_reuse_address = True
+
+
+class _SinglePageAppHandler(SimpleHTTPRequestHandler):
+ def __init__(self, *args: Any, directory: str, **kwargs: Any) -> None:
+ super().__init__(*args, directory=directory, **kwargs)
+
+ def log_message(self, format: str, *args: Any) -> None: # noqa: A002
+ return
+
+ def send_head(self) -> Any:
+ parsed = urllib.parse.urlparse(self.path)
+ if self.command in {"GET", "HEAD"} and _should_serve_spa_index(parsed.path):
+ self.path = "/index.html"
+ return super().send_head()
+
+
+class _ArtifactHandler(BaseHTTPRequestHandler):
+ server_version = "SkyvernArtifactServer/1.0"
+ artifact_token: str | None = None
+ artifact_roots: tuple[Path, ...] = ()
+ ui_port: int = UI_PORT
+
+ def log_message(self, format: str, *args: Any) -> None: # noqa: A002
+ return
+
+ def end_headers(self) -> None:
+ cors_origin = self._cors_origin()
+ if cors_origin is not None:
+ self.send_header("Access-Control-Allow-Origin", cors_origin)
+ self.send_header("Vary", "Origin")
+ self.send_header("Access-Control-Allow-Methods", "GET, OPTIONS")
+ self.send_header("Access-Control-Allow-Headers", "Range, Content-Type")
+ self.send_header("Referrer-Policy", "no-referrer")
+ super().end_headers()
+
+ def do_OPTIONS(self) -> None:
+ self.send_response(HTTPStatus.NO_CONTENT)
+ self.end_headers()
+
+ def do_GET(self) -> None:
+ parsed = urllib.parse.urlparse(self.path)
+ route_path = self._route_path(parsed.path)
+ if route_path is None:
+ self.send_error(HTTPStatus.NOT_FOUND, "Unknown artifact endpoint")
+ return
+
+ params = urllib.parse.parse_qs(parsed.query)
+ raw_path = params.get("path", [None])[0]
+
+ if route_path == "/artifact/recording":
+ self._send_recording(raw_path)
+ return
+ if route_path == "/artifact/image":
+ self._send_file(raw_path)
+ return
+ if route_path == "/artifact/json":
+ self._send_json(raw_path)
+ return
+ if route_path == "/artifact/text":
+ self._send_text(raw_path)
+ return
+
+ self.send_error(HTTPStatus.NOT_FOUND, "Unknown artifact endpoint")
+
+ def _cors_origin(self) -> str | None:
+ localhost_origin, loopback_origin = _local_ui_origins(self.ui_port)
+ request_origin = self.headers.get("Origin")
+ if request_origin == localhost_origin:
+ return localhost_origin
+ if request_origin == loopback_origin:
+ return loopback_origin
+ return None
+
+ def _route_path(self, parsed_path: str) -> str | None:
+ if self.artifact_token is None:
+ return parsed_path
+ token_prefix = f"/{self.artifact_token}"
+ if parsed_path == token_prefix:
+ return "/"
+ if not parsed_path.startswith(f"{token_prefix}/"):
+ return None
+ return parsed_path[len(token_prefix) :]
+
+ def _send_validated_artifact(self, raw_path: str | None, artifact_kind: str) -> None:
+ if raw_path is None:
+ self.send_error(HTTPStatus.BAD_REQUEST, "Missing path")
+ return
+ normalized = _normalize_artifact_path(raw_path)
+ if normalized is None:
+ self.send_error(HTTPStatus.BAD_REQUEST, "Invalid artifact path")
+ return
+ for root in self.artifact_roots:
+ root_path = os.path.realpath(root)
+ root_prefix = root_path if root_path.endswith(os.sep) else f"{root_path}{os.sep}"
+ if normalized.startswith(root_prefix):
+ try:
+ with open(normalized, "rb") as stream:
+ file_size = os.fstat(stream.fileno()).st_size
+
+ if artifact_kind == "recording":
+ range_header = self.headers.get("Range")
+ if not range_header:
+ self.send_error(HTTPStatus.BAD_REQUEST, "Missing range header")
+ return
+
+ match = re.match(r"bytes=(\d+)-", range_header)
+ start = int(match.group(1)) if match else 0
+ if start >= file_size:
+ self.send_error(HTTPStatus.REQUESTED_RANGE_NOT_SATISFIABLE)
+ return
+ end = min(start + 1_000_000, file_size) - 1
+ content_length = end - start + 1
+
+ self.send_response(HTTPStatus.PARTIAL_CONTENT)
+ self.send_header("Content-Range", f"bytes {start}-{end}/{file_size}")
+ self.send_header("Accept-Ranges", "bytes")
+ self.send_header("Content-Length", str(content_length))
+ self.send_header("Content-Type", "video/mp4")
+ self.end_headers()
+ stream.seek(start)
+ self.wfile.write(stream.read(content_length))
+ return
+ if artifact_kind == "image":
+ self.send_response(HTTPStatus.OK)
+ self.send_header("Content-Type", _image_content_type(normalized))
+ self.send_header("Content-Length", str(file_size))
+ self.end_headers()
+ shutil.copyfileobj(stream, self.wfile)
+ return
+ if artifact_kind == "json":
+ try:
+ payload = json.loads(stream.read().decode("utf-8"))
+ except Exception:
+ self.send_error(HTTPStatus.INTERNAL_SERVER_ERROR, "Invalid artifact JSON")
+ return
+ encoded = json.dumps(payload).encode("utf-8")
+ self.send_response(HTTPStatus.OK)
+ self.send_header("Content-Type", "application/json")
+ self.send_header("Content-Length", str(len(encoded)))
+ self.end_headers()
+ self.wfile.write(encoded)
+ return
+ if artifact_kind == "text":
+ contents = stream.read()
+ self.send_response(HTTPStatus.OK)
+ self.send_header("Content-Type", "text/plain; charset=utf-8")
+ self.send_header("Content-Length", str(len(contents)))
+ self.end_headers()
+ self.wfile.write(contents)
+ return
+
+ self.send_error(HTTPStatus.NOT_FOUND, "Unknown artifact endpoint")
+ return
+ except OSError:
+ self.send_error(HTTPStatus.NOT_FOUND, "Artifact not found")
+ return
+
+ self.send_error(HTTPStatus.FORBIDDEN, "Artifact path is outside the configured roots")
+ return
+
+ def _send_recording(self, raw_path: str | None) -> None:
+ self._send_validated_artifact(raw_path, "recording")
+
+ def _send_file(self, raw_path: str | None) -> None:
+ self._send_validated_artifact(raw_path, "image")
+
+ def _send_json(self, raw_path: str | None) -> None:
+ self._send_validated_artifact(raw_path, "json")
+
+ def _send_text(self, raw_path: str | None) -> None:
+ self._send_validated_artifact(raw_path, "text")
+
+
+def _artifact_handler_class(
+ *,
+ artifact_token: str | None,
+ artifact_roots: tuple[Path, ...],
+ ui_port: int,
+) -> type[_ArtifactHandler]:
+ class ConfiguredArtifactHandler(_ArtifactHandler):
+ pass
+
+ ConfiguredArtifactHandler.artifact_token = artifact_token
+ ConfiguredArtifactHandler.artifact_roots = artifact_roots
+ ConfiguredArtifactHandler.ui_port = _validate_tcp_port(ui_port)
+ return ConfiguredArtifactHandler
+
+
+def serve_installed_ui(
+ dist_dir: Path,
+ *,
+ ui_port: int = UI_PORT,
+ artifact_port: int = ARTIFACT_PORT,
+ artifact_token: str | None = None,
+) -> None:
+ """Serve prebuilt UI assets and local artifact endpoints without Node."""
+
+ def ui_handler(*args: Any, **kwargs: Any) -> _SinglePageAppHandler:
+ return _SinglePageAppHandler(*args, directory=str(dist_dir), **kwargs)
+
+ artifact_handler = _artifact_handler_class(
+ artifact_token=artifact_token,
+ artifact_roots=_configured_artifact_roots(),
+ ui_port=ui_port,
+ )
+ ui_server = _ReusableThreadingHTTPServer((UI_BIND_HOST, ui_port), ui_handler)
+ artifact_server = _ReusableThreadingHTTPServer((UI_BIND_HOST, artifact_port), artifact_handler)
+ artifact_thread = threading.Thread(target=artifact_server.serve_forever, daemon=True)
+ artifact_thread.start()
+
+ try:
+ webbrowser.open(f"http://localhost:{ui_port}")
+ ui_server.serve_forever()
+ except KeyboardInterrupt:
+ return
+ finally:
+ ui_server.shutdown()
+ ui_server.server_close()
+ artifact_server.shutdown()
+ artifact_server.server_close()
+ artifact_thread.join(timeout=5)
diff --git a/skyvern/cli/utils.py b/skyvern/cli/utils.py
index 9e62f17d7..f1eef549f 100644
--- a/skyvern/cli/utils.py
+++ b/skyvern/cli/utils.py
@@ -5,12 +5,14 @@ import sys
import time
import typer
+from rich.markup import escape
from rich.panel import Panel
from rich.progress import Progress, SpinnerColumn, TextColumn
from skyvern.analytics import capture_setup_error, capture_setup_event
from skyvern.cli.console import console
-from skyvern.utils.env_paths import resolve_backend_env_path, resolve_frontend_env_path
+from skyvern.cli.ui_runtime import has_frontend_runtime
+from skyvern.utils.env_paths import resolve_backend_env_path
def wait_for_docker_services(ui_port: int = 8080, api_port: int = 8000, timeout: int = 120) -> bool:
@@ -48,14 +50,14 @@ async def start_services(server_only: bool = False) -> None:
server_only: If True, only start the server, not the UI.
"""
try:
- frontend_env_path = None if server_only else resolve_frontend_env_path()
- if not server_only and frontend_env_path is None:
+ frontend_available = False if server_only else has_frontend_runtime()
+ if not server_only and not frontend_available:
server_only = True
console.print(
Panel(
"[yellow]No Skyvern frontend runtime was found in this install.[/yellow]\n\n"
- "Starting the backend API server only. Wheel installs do not include the UI app; "
- "use a source checkout or Docker Compose when you need the local UI.",
+ f"Starting the backend API server only. Install [cyan]{escape('skyvern[ui]')}[/cyan] "
+ "or use a source checkout / Docker Compose when you need the local UI.",
title="Backend-only install",
border_style="yellow",
)
diff --git a/tests/unit/test_init_mcp.py b/tests/unit/test_init_mcp.py
index 0054db577..dd0473723 100644
--- a/tests/unit/test_init_mcp.py
+++ b/tests/unit/test_init_mcp.py
@@ -47,5 +47,21 @@ def test_init_callback_passes_plain_database_string(monkeypatch) -> None:
result = CliRunner().invoke(cli_app, ["init"])
+ assert result.exit_code == 0
+ assert calls == [(True, "", None)]
+
+
+def test_init_callback_postgres_flag_preserves_postgres_setup(monkeypatch) -> None:
+ calls: list[tuple[bool, str, str | None]] = []
+
+ monkeypatch.setattr(
+ "skyvern.cli.init_command.init_env",
+ lambda no_postgres=False, database_string="", env_scope=None: calls.append(
+ (no_postgres, database_string, env_scope)
+ ),
+ )
+
+ result = CliRunner().invoke(cli_app, ["init", "--postgres"])
+
assert result.exit_code == 0
assert calls == [(False, "", None)]
diff --git a/tests/unit/test_pyproject_extras.py b/tests/unit/test_pyproject_extras.py
new file mode 100644
index 000000000..dc8973fd1
--- /dev/null
+++ b/tests/unit/test_pyproject_extras.py
@@ -0,0 +1,24 @@
+from __future__ import annotations
+
+import tomllib
+from pathlib import Path
+
+
+def _pyproject() -> dict:
+ return tomllib.loads(Path("pyproject.toml").read_text())
+
+
+def test_all_extra_stays_in_sync_with_server_plus_ui() -> None:
+ optional_dependencies = _pyproject()["project"]["optional-dependencies"]
+
+ assert sorted(optional_dependencies["all"]) == sorted(optional_dependencies["server"] + optional_dependencies["ui"])
+
+
+def test_skyvern_ui_versions_match_root_package() -> None:
+ root_version = _pyproject()["project"]["version"]
+ ui_pyproject = tomllib.loads(Path("packages/skyvern-ui/pyproject.toml").read_text())
+ ui_module = Path("packages/skyvern-ui/skyvern_ui/__init__.py").read_text()
+
+ assert ui_pyproject["project"]["version"] == root_version
+ assert f'__version__ = "{root_version}"' in ui_module
+ assert _pyproject()["project"]["optional-dependencies"]["ui"] == [f"skyvern-ui=={root_version}"]
diff --git a/tests/unit/test_quickstart.py b/tests/unit/test_quickstart.py
index 45d893fac..63ae25c40 100644
--- a/tests/unit/test_quickstart.py
+++ b/tests/unit/test_quickstart.py
@@ -186,3 +186,82 @@ def test_bootstrap_skips_rewrite_for_non_localhost_db_string(tmp_path: Path, mon
assert confirm_calls == [], "should not prompt when DATABASE_STRING does not point to localhost"
assert (tmp_path / ".env").read_text() == env_content
+
+
+def test_run_server_quickstart_uses_sqlite_by_default(monkeypatch: pytest.MonkeyPatch) -> None:
+ init_calls: list[dict[str, object]] = []
+
+ class InitResult:
+ run_local = False
+
+ def __bool__(self) -> bool:
+ return False
+
+ monkeypatch.setattr(
+ init_command,
+ "init_env",
+ lambda **kwargs: init_calls.append(kwargs) or InitResult(),
+ )
+
+ quickstart._run_server_quickstart(
+ no_postgres=False,
+ database_string="",
+ skip_browser_install=False,
+ server_only=False,
+ )
+
+ assert init_calls == [
+ {
+ "no_postgres": True,
+ "database_string": "",
+ "skip_browser_install": False,
+ "mode": "local",
+ "skip_llm_setup": False,
+ "configure_mcp": None,
+ "browser_type": None,
+ "browser_location": None,
+ "remote_debugging_url": None,
+ "analytics_id": None,
+ "return_result": True,
+ }
+ ]
+
+
+def test_run_server_quickstart_can_request_postgres(monkeypatch: pytest.MonkeyPatch) -> None:
+ init_calls: list[dict[str, object]] = []
+
+ class InitResult:
+ run_local = False
+
+ def __bool__(self) -> bool:
+ return False
+
+ monkeypatch.setattr(
+ init_command,
+ "init_env",
+ lambda **kwargs: init_calls.append(kwargs) or InitResult(),
+ )
+
+ quickstart._run_server_quickstart(
+ no_postgres=False,
+ postgres=True,
+ database_string="",
+ skip_browser_install=False,
+ server_only=False,
+ )
+
+ assert init_calls == [
+ {
+ "no_postgres": False,
+ "database_string": "",
+ "skip_browser_install": False,
+ "mode": "local",
+ "skip_llm_setup": False,
+ "configure_mcp": None,
+ "browser_type": None,
+ "browser_location": None,
+ "remote_debugging_url": None,
+ "analytics_id": None,
+ "return_result": True,
+ }
+ ]
diff --git a/tests/unit/test_quickstart_browser_install.py b/tests/unit/test_quickstart_browser_install.py
index ac43ab377..2d0320164 100644
--- a/tests/unit/test_quickstart_browser_install.py
+++ b/tests/unit/test_quickstart_browser_install.py
@@ -95,8 +95,20 @@ def test_quickstart_does_not_start_services_when_required_browser_is_missing(
quickstart_module.quickstart(
ctx=None, # type: ignore[arg-type]
no_postgres=False,
+ postgres=False,
database_string="",
skip_browser_install=False,
server_only=False,
docker_compose=False,
+ install_type=None,
+ env_scope=None,
+ yes=False,
+ non_interactive=False,
+ skip_llm_setup=False,
+ skip_mcp=False,
+ browser_type=None,
+ browser_location=None,
+ remote_debugging_url=None,
+ analytics_id=None,
+ start_services_now=None,
)
diff --git a/tests/unit/test_quickstart_command.py b/tests/unit/test_quickstart_command.py
index 3d5a87b66..32a17bf7d 100644
--- a/tests/unit/test_quickstart_command.py
+++ b/tests/unit/test_quickstart_command.py
@@ -425,11 +425,11 @@ def test_quickstart_without_server_extra_prints_install_paths(monkeypatch) -> No
assert result.exit_code == 0
assert "Cloud/API SDK usage" in result.output
assert "Embedded local Python SDK via skyvern[local]" in result.output
- assert "Self-hosted local server via skyvern[server]" in result.output
+ assert "Self-hosted local server + web UI via skyvern[all]" in result.output
assert "Next command: skyvern setup" in result.output
assert "Skyvern(api_key=" in result.output
assert 'pip install "skyvern[local]"' in result.output
- assert 'pip install "skyvern[server]"' in result.output
+ assert 'pip install "skyvern[all]"' in result.output
assert "Postgres" in result.output
assert "Missing Dependency" not in result.output
assert "Missing:" not in result.output
@@ -491,7 +491,7 @@ def test_quickstart_server_flags_select_server_path_without_server_extra(monkeyp
assert result.exit_code == 0
assert "Embedded local Python SDK" not in result.output
assert "Cloud/API SDK usage" not in result.output
- assert 'Install: pip install "skyvern[server]"' in result.output
+ assert 'Install: pip install "skyvern[all]"' in result.output
assert install_calls == []
assert server_calls == []
@@ -538,10 +538,11 @@ def test_quickstart_interactive_server_choice_without_server_extra_prints_instal
assert result.exit_code == 1
assert "Choose a quickstart path" in result.output
assert "Install the missing server dependencies now?" in result.output
- assert 'Install: pip install "skyvern[server]"' in result.output
+ assert 'Install: pip install "skyvern[all]"' in result.output
assert "Next: python -m skyvern quickstart" in result.output
- assert "local server, database, local API key, and MCP" in result.output
- assert "Wheel installs run the backend only" in result.output
+ assert "local server, packaged UI, SQLite database, local API" in result.output
+ assert "key, and MCP" in result.output
+ assert "frontend development" in result.output
def test_quickstart_interactive_server_choice_can_install_server_extra(monkeypatch) -> None:
@@ -563,10 +564,65 @@ def test_quickstart_interactive_server_choice_can_install_server_extra(monkeypat
result = CliRunner().invoke(quickstart_module.quickstart_app, [], input="3\n")
assert result.exit_code == 0
- assert install_calls == [{"assume_yes": False}]
+ assert install_calls == [{"include_ui": True, "assume_yes": False}]
+ assert server_calls == [
+ {
+ "no_postgres": False,
+ "postgres": False,
+ "database_string": "",
+ "skip_browser_install": False,
+ "server_only": False,
+ }
+ ]
+
+
+def test_quickstart_existing_server_extra_can_install_ui_before_starting(monkeypatch) -> None:
+ ui_install_calls = []
+ server_calls = []
+
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: True)
+ monkeypatch.setattr(quickstart_module, "has_frontend_runtime", lambda: False)
+ monkeypatch.setattr(
+ "skyvern.cli.run_commands._install_packaged_ui_if_requested",
+ lambda: ui_install_calls.append("ui") or True,
+ )
+ monkeypatch.setattr(quickstart_module, "_run_server_quickstart", lambda **kwargs: server_calls.append(kwargs))
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--install-type", "server"])
+
+ assert result.exit_code == 0
+ assert ui_install_calls == ["ui"]
+ assert server_calls == [
+ {
+ "no_postgres": False,
+ "postgres": False,
+ "database_string": "",
+ "skip_browser_install": False,
+ "server_only": False,
+ }
+ ]
+
+
+def test_quickstart_postgres_flag_preserves_postgres_setup(monkeypatch) -> None:
+ server_calls = []
+
+ monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
+ monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_has_server_quickstart_extra", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_is_interactive_input", lambda: False)
+ monkeypatch.setattr(quickstart_module, "has_frontend_runtime", lambda: True)
+ monkeypatch.setattr(quickstart_module, "_run_server_quickstart", lambda **kwargs: server_calls.append(kwargs))
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--install-type", "server", "--postgres"])
+
+ assert result.exit_code == 0
assert server_calls == [
{
"no_postgres": False,
+ "postgres": True,
"database_string": "",
"skip_browser_install": False,
"server_only": False,
@@ -574,6 +630,21 @@ def test_quickstart_interactive_server_choice_can_install_server_extra(monkeypat
]
+def test_quickstart_rejects_conflicting_postgres_flags(monkeypatch) -> None:
+ monkeypatch.setattr(
+ quickstart_module,
+ "_has_server_quickstart_extra",
+ lambda: (_ for _ in ()).throw(AssertionError("should not inspect dependencies")),
+ )
+
+ result = CliRunner().invoke(quickstart_module.quickstart_app, ["--postgres", "--no-postgres"])
+
+ assert result.exit_code == 1
+ assert "Conflicting quickstart options" in result.output
+ assert "--postgres" in result.output
+ assert "--no-postgres" in result.output
+
+
def test_quickstart_interactive_choice_accepts_alias(monkeypatch) -> None:
monkeypatch.setattr(quickstart_module, "check_docker_compose_file", lambda: False)
monkeypatch.setattr(quickstart_module, "_has_local_quickstart_extra", lambda: False)
@@ -599,7 +670,7 @@ def test_quickstart_interactive_choice_reprompts_invalid_alias(monkeypatch) -> N
assert "Choose one of: cloud/api, local/embedded, server/self-hosted, 1, 2, or 3." in result.output
assert "Please select a valid option:" not in result.output
assert "Install the missing server dependencies now?" in result.output
- assert 'Install: pip install "skyvern[server]"' in result.output
+ assert 'Install: pip install "skyvern[all]"' in result.output
def test_quickstart_interactive_eof_falls_back_to_default(monkeypatch) -> None:
@@ -634,7 +705,7 @@ def test_quickstart_server_flags_skip_docker_compose_offer_without_server_extra(
monkeypatch.setattr(
quickstart_module,
"_install_server_extra_for_quickstart",
- lambda: install_calls.append("install") or True,
+ lambda **kwargs: install_calls.append(kwargs) or True,
)
monkeypatch.setattr(quickstart_module, "_run_server_quickstart", lambda **kwargs: server_calls.append(kwargs))
@@ -727,6 +798,7 @@ def test_quickstart_with_server_extra_preserves_existing_flow(monkeypatch) -> No
assert calls == [
{
"no_postgres": True,
+ "postgres": False,
"database_string": "postgresql+psycopg://user/db",
"skip_browser_install": True,
"server_only": True,
@@ -796,7 +868,7 @@ async def test_start_services_without_frontend_runtime_starts_backend_only(monke
async def fake_sleep(_seconds: float) -> None:
return None
- monkeypatch.setattr(utils, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(utils, "has_frontend_runtime", lambda: False)
monkeypatch.setattr(utils, "resolve_backend_env_path", lambda **_kwargs: Path(".env"))
monkeypatch.setattr(utils.asyncio, "create_subprocess_exec", fake_create_subprocess_exec)
monkeypatch.setattr(utils.asyncio, "sleep", fake_sleep)
@@ -805,3 +877,34 @@ async def test_start_services_without_frontend_runtime_starts_backend_only(monke
await utils.start_services()
assert commands == [(utils.sys.executable, "-m", "skyvern.cli.commands", "run", "server")]
+
+
+async def test_start_services_with_packaged_frontend_runtime_starts_ui(monkeypatch) -> None:
+ import skyvern.cli.utils as utils
+
+ commands = []
+
+ class FakeProcess:
+ async def wait(self) -> int:
+ return 0
+
+ async def fake_create_subprocess_exec(*args):
+ commands.append(args)
+ return FakeProcess()
+
+ async def fake_sleep(_seconds: float) -> None:
+ return None
+
+ monkeypatch.setattr(utils, "has_frontend_runtime", lambda: True)
+ monkeypatch.setattr(utils, "resolve_backend_env_path", lambda **_kwargs: Path(".env"))
+ monkeypatch.setattr(utils.asyncio, "create_subprocess_exec", fake_create_subprocess_exec)
+ monkeypatch.setattr(utils.asyncio, "sleep", fake_sleep)
+ monkeypatch.setattr(utils, "capture_setup_event", lambda *args, **kwargs: None)
+
+ await utils.start_services()
+
+ assert commands == [
+ (utils.sys.executable, "-m", "skyvern.cli.commands", "run", "server"),
+ (utils.sys.executable, "-m", "skyvern.cli.commands", "run", "ui"),
+ ]
diff --git a/tests/unit/test_quickstart_server_extra.py b/tests/unit/test_quickstart_server_extra.py
index a23b87dde..50dea30c7 100644
--- a/tests/unit/test_quickstart_server_extra.py
+++ b/tests/unit/test_quickstart_server_extra.py
@@ -11,7 +11,7 @@ from skyvern.cli.quickstart import quickstart_app
def test_install_server_extra_assume_yes_skips_prompt(monkeypatch) -> None:
commands: list[list[str]] = []
- monkeypatch.setattr(quickstart_module, "_server_extra_install_target", lambda: "skyvern[server]==1.2.3")
+ monkeypatch.setattr(quickstart_module, "_server_extra_install_target", lambda **_kwargs: "skyvern[server]==1.2.3")
monkeypatch.setattr(
quickstart_module.Confirm,
"ask",
diff --git a/tests/unit/test_run_commands_ui.py b/tests/unit/test_run_commands_ui.py
new file mode 100644
index 000000000..6b5839cda
--- /dev/null
+++ b/tests/unit/test_run_commands_ui.py
@@ -0,0 +1,377 @@
+from __future__ import annotations
+
+import importlib
+import logging
+import subprocess
+from pathlib import Path
+
+import pytest
+import typer
+
+from skyvern.cli import run_commands
+
+
+def test_run_ui_without_source_or_packaged_assets_prints_install_hint(monkeypatch, capsys) -> None:
+ port_checks: list[int] = []
+
+ monkeypatch.setattr(run_commands, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(run_commands, "installed_ui_dist_available", lambda: False)
+ monkeypatch.setattr(run_commands, "is_interactive", lambda: False)
+ monkeypatch.setattr(
+ run_commands,
+ "_handle_port_conflict",
+ lambda port, **_kwargs: port_checks.append(port) or True,
+ )
+
+ run_commands.run_ui()
+
+ captured = capsys.readouterr()
+ assert "Skyvern UI assets are not installed" in captured.out
+ assert 'pip install "skyvern[ui]"' in captured.out
+ assert port_checks == []
+
+
+def test_run_ui_can_install_packaged_assets_interactively(tmp_path, monkeypatch) -> None:
+ install_commands: list[list[str]] = []
+ prompts: list[str] = []
+ cache_invalidated = False
+ availability = iter([False, True, True])
+ served = []
+
+ monkeypatch.setattr(run_commands, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(run_commands, "installed_ui_dist_available", lambda: next(availability))
+ monkeypatch.setattr(run_commands, "is_interactive", lambda: True)
+ monkeypatch.setattr(run_commands, "_ui_install_target", lambda: "skyvern-ui==1.0.36")
+ monkeypatch.setattr(
+ run_commands,
+ "_ui_install_command",
+ lambda install_target: [run_commands.sys.executable, "-m", "pip", "install", install_target],
+ )
+ monkeypatch.setattr(
+ run_commands.Confirm,
+ "ask",
+ lambda message, **_kwargs: prompts.append(message) or True,
+ )
+ monkeypatch.setattr(
+ run_commands,
+ "_handle_port_conflict",
+ lambda _port, **_kwargs: True,
+ )
+ monkeypatch.setattr(run_commands, "prepare_installed_ui_dist", lambda _config: tmp_path / "runtime")
+
+ def fake_run(command: list[str], **_kwargs):
+ install_commands.append(command)
+ return subprocess.CompletedProcess(command, 0)
+
+ def fake_invalidate_caches() -> None:
+ nonlocal cache_invalidated
+ cache_invalidated = True
+
+ def fake_serve(dist_dir: Path, *, ui_port: int, artifact_port: int, artifact_token: str | None = None) -> None:
+ del artifact_token
+ served.append((dist_dir, ui_port, artifact_port))
+
+ monkeypatch.setattr(run_commands.subprocess, "run", fake_run)
+ monkeypatch.setattr(run_commands.importlib, "invalidate_caches", fake_invalidate_caches)
+ monkeypatch.setattr(run_commands, "serve_installed_ui", fake_serve)
+
+ run_commands.run_ui()
+
+ assert prompts == ["Install packaged Skyvern UI assets now (skyvern-ui==1.0.36)?"]
+ assert install_commands == [[run_commands.sys.executable, "-m", "pip", "install", "skyvern-ui==1.0.36"]]
+ assert cache_invalidated is True
+ assert served == [(tmp_path / "runtime", run_commands.UI_PORT, run_commands.ARTIFACT_PORT)]
+
+
+def test_run_ui_install_ui_flag_skips_interactive_prompt(tmp_path, monkeypatch) -> None:
+ install_commands: list[list[str]] = []
+ availability = iter([False, True])
+ served = []
+
+ monkeypatch.setattr(run_commands, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(run_commands, "installed_ui_dist_available", lambda: next(availability))
+ monkeypatch.setattr(run_commands, "_ui_install_target", lambda: "skyvern-ui==1.0.36")
+ monkeypatch.setattr(
+ run_commands,
+ "_ui_install_command",
+ lambda install_target: [run_commands.sys.executable, "-m", "pip", "install", install_target],
+ )
+ monkeypatch.setattr(
+ run_commands.Confirm,
+ "ask",
+ lambda *_args, **_kwargs: pytest.fail("run ui --install-ui should not prompt"),
+ )
+ monkeypatch.setattr(
+ run_commands,
+ "_handle_port_conflict",
+ lambda _port, **_kwargs: True,
+ )
+ monkeypatch.setattr(run_commands, "prepare_installed_ui_dist", lambda _config: tmp_path / "runtime")
+
+ def fake_run(command: list[str], **_kwargs):
+ install_commands.append(command)
+ return subprocess.CompletedProcess(command, 0)
+
+ def fake_serve(dist_dir: Path, *, ui_port: int, artifact_port: int, artifact_token: str | None = None) -> None:
+ del artifact_token
+ served.append((dist_dir, ui_port, artifact_port))
+
+ monkeypatch.setattr(run_commands.subprocess, "run", fake_run)
+ monkeypatch.setattr(run_commands, "serve_installed_ui", fake_serve)
+
+ run_commands.run_ui(install_ui=True)
+
+ assert install_commands == [[run_commands.sys.executable, "-m", "pip", "install", "skyvern-ui==1.0.36"]]
+ assert served == [(tmp_path / "runtime", run_commands.UI_PORT, run_commands.ARTIFACT_PORT)]
+
+
+def test_run_all_can_install_ui_before_starting_services(monkeypatch) -> None:
+ calls = []
+
+ async def fake_start_services() -> None:
+ calls.append("start")
+
+ monkeypatch.setattr(run_commands, "has_frontend_runtime", lambda: False)
+ monkeypatch.setattr(run_commands, "_missing_run_all_dependencies", lambda: [])
+ monkeypatch.setattr(
+ run_commands,
+ "_install_packaged_ui_if_requested",
+ lambda *, assume_yes: calls.append(("install", assume_yes)) or True,
+ )
+ monkeypatch.setattr("skyvern.cli.utils.start_services", fake_start_services)
+
+ run_commands.run_all(install_ui=True)
+
+ assert calls == [("install", True), "start"]
+
+
+def test_run_all_install_ui_exits_when_explicit_install_fails(monkeypatch) -> None:
+ calls = []
+
+ async def fake_start_services() -> None:
+ calls.append("start")
+
+ monkeypatch.setattr(run_commands, "has_frontend_runtime", lambda: False)
+ monkeypatch.setattr(run_commands, "_missing_run_all_dependencies", lambda: [])
+ monkeypatch.setattr(
+ run_commands,
+ "_install_packaged_ui_if_requested",
+ lambda *, assume_yes: calls.append(("install", assume_yes)) or False,
+ )
+ monkeypatch.setattr("skyvern.cli.utils.start_services", fake_start_services)
+
+ with pytest.raises(typer.Exit) as exc_info:
+ run_commands.run_all(install_ui=True)
+
+ assert exc_info.value.exit_code == 1
+ assert calls == [("install", True)]
+
+
+def test_run_all_without_install_ui_can_degrade_to_backend_only(monkeypatch) -> None:
+ calls = []
+
+ async def fake_start_services() -> None:
+ calls.append("start")
+
+ monkeypatch.setattr(run_commands, "has_frontend_runtime", lambda: False)
+ monkeypatch.setattr(run_commands, "_missing_run_all_dependencies", lambda: [])
+ monkeypatch.setattr(
+ run_commands,
+ "_install_packaged_ui_if_requested",
+ lambda *, assume_yes: calls.append(("install", assume_yes)) or False,
+ )
+ monkeypatch.setattr("skyvern.cli.utils.start_services", fake_start_services)
+
+ run_commands.run_all()
+
+ assert calls == [("install", False), "start"]
+
+
+def test_install_packaged_ui_warns_when_non_interactive(monkeypatch, capsys, caplog) -> None:
+ monkeypatch.setattr(run_commands, "is_interactive", lambda: False)
+ monkeypatch.setattr(run_commands, "_ui_install_target", lambda: "skyvern-ui==1.0.36")
+ monkeypatch.setattr(
+ run_commands,
+ "_ui_install_command",
+ lambda install_target: [run_commands.sys.executable, "-m", "pip", "install", install_target],
+ )
+
+ with caplog.at_level(logging.WARNING):
+ installed = run_commands._install_packaged_ui_if_requested()
+
+ captured = capsys.readouterr()
+ assert installed is False
+ assert "Automatic install was skipped" in captured.out
+ assert any(record.message == "packaged_ui_install_skipped_non_interactive" for record in caplog.records)
+
+
+def test_run_all_skips_ui_install_when_runtime_exists(monkeypatch) -> None:
+ calls = []
+
+ async def fake_start_services() -> None:
+ calls.append("start")
+
+ monkeypatch.setattr(run_commands, "has_frontend_runtime", lambda: True)
+ monkeypatch.setattr(run_commands, "_missing_run_all_dependencies", lambda: [])
+ monkeypatch.setattr(
+ run_commands,
+ "_install_packaged_ui_if_requested",
+ lambda *, assume_yes: calls.append(("install", assume_yes)) or True,
+ )
+ monkeypatch.setattr("skyvern.cli.utils.start_services", fake_start_services)
+
+ run_commands.run_all()
+
+ assert calls == ["start"]
+
+
+def test_run_all_without_server_dependencies_prints_all_extra_hint(monkeypatch, capsys) -> None:
+ monkeypatch.setattr(run_commands, "_missing_run_all_dependencies", lambda: ["uvicorn", "sqlalchemy"])
+ monkeypatch.setattr(
+ "skyvern.cli.utils.start_services",
+ lambda: pytest.fail("run all should not import/start services when server deps are missing"),
+ )
+
+ with pytest.raises(typer.Exit):
+ run_commands.run_all(install_ui=True)
+
+ captured = capsys.readouterr()
+ assert "`skyvern run all` needs the local server dependencies" in captured.out
+ assert 'pip install "skyvern[all]"' in captured.out
+ assert "skyvern run ui --install-ui" in captured.out
+
+
+def test_ui_install_target_matches_installed_skyvern_version(monkeypatch) -> None:
+ monkeypatch.setattr(run_commands.importlib.metadata, "version", lambda _package: "1.2.3")
+
+ assert run_commands._ui_install_target() == "skyvern-ui==1.2.3"
+
+
+def test_ui_install_target_falls_back_when_skyvern_metadata_is_missing(monkeypatch) -> None:
+ def raise_package_not_found(_package: str) -> str:
+ raise importlib.metadata.PackageNotFoundError
+
+ monkeypatch.setattr(run_commands.importlib.metadata, "version", raise_package_not_found)
+
+ assert run_commands._ui_install_target() == "skyvern-ui"
+
+
+def test_ui_install_command_prefers_uv_inside_virtualenv(monkeypatch) -> None:
+ monkeypatch.setenv("VIRTUAL_ENV", "/tmp/.venv")
+ monkeypatch.setattr(run_commands.shutil, "which", lambda binary: "/usr/local/bin/uv" if binary == "uv" else None)
+
+ assert run_commands._ui_install_command("skyvern-ui==1.0.36") == [
+ "/usr/local/bin/uv",
+ "pip",
+ "install",
+ "skyvern-ui==1.0.36",
+ ]
+
+
+def test_ui_install_command_uses_python_pip_without_uv_virtualenv(monkeypatch) -> None:
+ monkeypatch.delenv("VIRTUAL_ENV", raising=False)
+ monkeypatch.delenv("UV_PROJECT_ENVIRONMENT", raising=False)
+ monkeypatch.setattr(run_commands.shutil, "which", lambda _binary: "/usr/local/bin/uv")
+
+ assert run_commands._ui_install_command("skyvern-ui==1.0.36") == [
+ run_commands.sys.executable,
+ "-m",
+ "pip",
+ "install",
+ "skyvern-ui==1.0.36",
+ ]
+
+
+def test_installed_ui_config_accepts_frontend_env_vars(tmp_path, monkeypatch) -> None:
+ monkeypatch.setenv("VITE_API_BASE_URL", "https://api.example.com/api/v1")
+ monkeypatch.delenv("VITE_WSS_BASE_URL", raising=False)
+ monkeypatch.setenv("VITE_ARTIFACT_API_BASE_URL", "https://artifacts.example.com")
+ monkeypatch.setenv("VITE_SKYVERN_API_KEY", "frontend-key")
+ monkeypatch.setenv("VITE_BROWSER_STREAMING_MODE", "cdp")
+ monkeypatch.setattr(run_commands, "resolve_backend_env_path", lambda **_kwargs: tmp_path / ".env")
+
+ config = run_commands._installed_ui_config()
+
+ assert config.api_base_url == "https://api.example.com/api/v1"
+ assert config.wss_base_url == "wss://api.example.com/api/v1"
+ assert config.artifact_api_base_url == "https://artifacts.example.com"
+ assert config.skyvern_api_key == "frontend-key"
+ assert config.browser_streaming_mode == "cdp"
+
+
+def test_run_ui_with_packaged_assets_serves_python_runtime(tmp_path, monkeypatch) -> None:
+ port_checks: list[int] = []
+ prepared_configs = []
+ served = []
+
+ monkeypatch.setenv("PORT", "8765")
+ monkeypatch.setenv("SKYVERN_API_KEY", "test-key")
+ monkeypatch.setenv("BROWSER_STREAMING_MODE", "cdp")
+ monkeypatch.setattr(run_commands, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(run_commands, "installed_ui_dist_available", lambda: True)
+ monkeypatch.setattr(run_commands, "resolve_backend_env_path", lambda **_kwargs: tmp_path / ".env")
+ monkeypatch.setattr(run_commands.secrets, "token_urlsafe", lambda _size: "test-token")
+ monkeypatch.setattr(
+ run_commands,
+ "_handle_port_conflict",
+ lambda port, **_kwargs: port_checks.append(port) or True,
+ )
+
+ def fake_prepare(config):
+ prepared_configs.append(config)
+ return tmp_path / "runtime"
+
+ def fake_serve(dist_dir: Path, *, ui_port: int, artifact_port: int, artifact_token: str | None = None) -> None:
+ served.append((dist_dir, ui_port, artifact_port, artifact_token))
+
+ monkeypatch.setattr(run_commands, "prepare_installed_ui_dist", fake_prepare)
+ monkeypatch.setattr(run_commands, "serve_installed_ui", fake_serve)
+
+ run_commands.run_ui()
+
+ assert port_checks == [run_commands.UI_PORT, run_commands.ARTIFACT_PORT]
+ assert len(prepared_configs) == 1
+ config = prepared_configs[0]
+ assert config.api_base_url == "http://localhost:8765/api/v1"
+ assert config.wss_base_url == "ws://localhost:8765/api/v1"
+ assert config.artifact_api_base_url == "http://localhost:9090/test-token"
+ assert config.skyvern_api_key == "test-key"
+ assert config.browser_streaming_mode == "cdp"
+ assert served == [(tmp_path / "runtime", run_commands.UI_PORT, run_commands.ARTIFACT_PORT, "test-token")]
+
+
+def test_run_ui_with_packaged_assets_accepts_remote_api_options(tmp_path, monkeypatch) -> None:
+ prepared_configs = []
+ served = []
+
+ monkeypatch.setattr(run_commands, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(run_commands, "installed_ui_dist_available", lambda: True)
+ monkeypatch.setattr(run_commands, "resolve_backend_env_path", lambda **_kwargs: tmp_path / ".env")
+ monkeypatch.setattr(run_commands.secrets, "token_urlsafe", lambda _size: "test-token")
+ monkeypatch.setattr(run_commands, "_handle_port_conflict", lambda _port, **_kwargs: True)
+
+ def fake_prepare(config):
+ prepared_configs.append(config)
+ return tmp_path / "runtime"
+
+ def fake_serve(dist_dir: Path, *, ui_port: int, artifact_port: int, artifact_token: str | None = None) -> None:
+ served.append((dist_dir, ui_port, artifact_port, artifact_token))
+
+ monkeypatch.setattr(run_commands, "prepare_installed_ui_dist", fake_prepare)
+ monkeypatch.setattr(run_commands, "serve_installed_ui", fake_serve)
+
+ run_commands.run_ui(
+ api_url="https://api.example.com/api/v1",
+ artifact_api_url="https://artifacts.example.com",
+ api_key="remote-key",
+ browser_streaming_mode="cdp",
+ )
+
+ assert len(prepared_configs) == 1
+ config = prepared_configs[0]
+ assert config.api_base_url == "https://api.example.com/api/v1"
+ assert config.wss_base_url == "wss://api.example.com/api/v1"
+ assert config.artifact_api_base_url == "https://artifacts.example.com/test-token"
+ assert config.skyvern_api_key == "remote-key"
+ assert config.browser_streaming_mode == "cdp"
+ assert served == [(tmp_path / "runtime", run_commands.UI_PORT, run_commands.ARTIFACT_PORT, "test-token")]
diff --git a/tests/unit/test_ui_runtime.py b/tests/unit/test_ui_runtime.py
new file mode 100644
index 000000000..2449fa1f1
--- /dev/null
+++ b/tests/unit/test_ui_runtime.py
@@ -0,0 +1,298 @@
+from __future__ import annotations
+
+import sys
+import threading
+import urllib.parse
+from http.client import HTTPConnection
+from http.server import ThreadingHTTPServer
+from pathlib import Path
+
+from skyvern.cli import ui_runtime
+
+
+def _install_fake_ui_package(tmp_path: Path, monkeypatch) -> Path:
+ package_root = tmp_path / "package"
+ ui_package = package_root / "skyvern_ui"
+ asset_dir = ui_package / "dist" / "assets"
+ asset_dir.mkdir(parents=True)
+ (ui_package / "__init__.py").write_text('__version__ = "test-version"\n')
+ (ui_package / "dist" / "index.html").write_text("<html>__VITE_API_BASE_URL_PLACEHOLDER__</html>")
+ (asset_dir / "app.js").write_text(
+ "__VITE_WSS_BASE_URL_PLACEHOLDER__ "
+ "__VITE_ARTIFACT_API_BASE_URL_PLACEHOLDER__ "
+ "__SKYVERN_API_KEY_PLACEHOLDER__ "
+ "__VITE_BROWSER_STREAMING_MODE_PLACEHOLDER__"
+ )
+ monkeypatch.syspath_prepend(str(package_root))
+ sys.modules.pop("skyvern_ui", None)
+ return package_root
+
+
+def test_installed_ui_dist_detects_package_assets(tmp_path, monkeypatch) -> None:
+ _install_fake_ui_package(tmp_path, monkeypatch)
+
+ dist = ui_runtime.installed_ui_dist()
+
+ assert dist is not None
+ assert dist.joinpath("index.html").is_file()
+
+
+def test_prepare_installed_ui_dist_copies_assets_and_injects_runtime_values(tmp_path, monkeypatch) -> None:
+ _install_fake_ui_package(tmp_path, monkeypatch)
+ monkeypatch.setenv(ui_runtime.UI_CACHE_ENV_VAR, str(tmp_path / "cache"))
+
+ runtime_dist = ui_runtime.prepare_installed_ui_dist(
+ ui_runtime.InstalledUiConfig(
+ api_base_url="http://localhost:8000/api/v1",
+ wss_base_url="ws://localhost:8000/api/v1",
+ artifact_api_base_url="http://localhost:9090",
+ skyvern_api_key="test-key",
+ browser_streaming_mode="cdp",
+ )
+ )
+
+ assert runtime_dist == tmp_path / "cache" / "test-version" / "runtime"
+ assert (runtime_dist / "index.html").read_text() == "<html>http://localhost:8000/api/v1</html>"
+ assert (runtime_dist / "assets" / "app.js").read_text() == (
+ "ws://localhost:8000/api/v1 http://localhost:9090 test-key cdp"
+ )
+ assert (tmp_path / "cache").stat().st_mode & 0o777 == 0o700
+ assert (tmp_path / "cache" / "test-version").stat().st_mode & 0o777 == 0o700
+ assert runtime_dist.stat().st_mode & 0o777 == 0o700
+ assert (runtime_dist / "assets").stat().st_mode & 0o777 == 0o700
+ assert (runtime_dist / "index.html").stat().st_mode & 0o777 == 0o600
+ assert (runtime_dist / "assets" / "app.js").stat().st_mode & 0o777 == 0o600
+
+
+def test_artifact_api_base_url_with_token() -> None:
+ assert ui_runtime.artifact_api_base_url_with_token("http://localhost:9090/", "secret") == (
+ "http://localhost:9090/secret"
+ )
+
+
+def test_has_frontend_runtime_accepts_source_checkout(monkeypatch) -> None:
+ monkeypatch.setattr(ui_runtime, "resolve_frontend_env_path", lambda: Path("skyvern-frontend/.env"))
+ monkeypatch.setattr(ui_runtime, "installed_ui_dist_available", lambda: False)
+
+ assert ui_runtime.has_frontend_runtime() is True
+
+
+def test_has_frontend_runtime_accepts_installed_package(monkeypatch) -> None:
+ monkeypatch.setattr(ui_runtime, "resolve_frontend_env_path", lambda: None)
+ monkeypatch.setattr(ui_runtime, "installed_ui_dist_available", lambda: True)
+
+ assert ui_runtime.has_frontend_runtime() is True
+
+
+def test_spa_fallback_only_handles_extensionless_routes() -> None:
+ assert ui_runtime._should_serve_spa_index("/runs/local-task") is True
+ assert ui_runtime._should_serve_spa_index("/assets/app.js") is False
+ assert ui_runtime._should_serve_spa_index("/../outside.txt") is False
+
+
+def test_artifact_handler_options_omits_cors_when_origin_is_missing() -> None:
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ connection.request("OPTIONS", "/artifact/text")
+ response = connection.getresponse()
+
+ assert response.status == 204
+ assert response.getheader("Access-Control-Allow-Origin") is None
+ assert "Range" in (response.getheader("Access-Control-Allow-Headers") or "")
+ assert response.getheader("Referrer-Policy") == "no-referrer"
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
+
+
+def test_artifact_handler_options_allows_local_ui_origin() -> None:
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ connection.request("OPTIONS", "/artifact/text", headers={"Origin": "http://localhost:8080"})
+ response = connection.getresponse()
+
+ assert response.status == 204
+ assert response.getheader("Access-Control-Allow-Origin") == "http://localhost:8080"
+ assert response.getheader("Referrer-Policy") == "no-referrer"
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
+
+
+def test_artifact_handler_rejects_invalid_ui_port() -> None:
+ try:
+ ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(),
+ ui_port=0,
+ )
+ except ValueError:
+ return
+
+ raise AssertionError("Expected invalid UI port to be rejected")
+
+
+def test_artifact_handler_rejects_missing_token(tmp_path) -> None:
+ artifact = tmp_path / "artifact.txt"
+ artifact.write_text("secret")
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(tmp_path.resolve(),),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ connection.request("GET", f"/artifact/text?path={artifact}")
+ response = connection.getresponse()
+
+ assert response.status == 404
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
+
+
+def test_artifact_handler_rejects_paths_outside_allowed_roots(tmp_path) -> None:
+ allowed_root = tmp_path / "allowed"
+ outside_root = tmp_path / "outside"
+ allowed_root.mkdir()
+ outside_root.mkdir()
+ artifact = outside_root / "artifact.txt"
+ artifact.write_text("secret")
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(allowed_root.resolve(),),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ connection.request("GET", f"/token/artifact/text?path={artifact}")
+ response = connection.getresponse()
+
+ assert response.status == 403
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
+
+
+def test_artifact_handler_rejects_traversal_that_starts_with_allowed_root(tmp_path) -> None:
+ allowed_root = tmp_path / "allowed"
+ outside_root = tmp_path / "outside"
+ allowed_root.mkdir()
+ outside_root.mkdir()
+ artifact = outside_root / "artifact.txt"
+ artifact.write_text("secret")
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(allowed_root.resolve(),),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ traversal_path = allowed_root / ".." / "outside" / "artifact.txt"
+ connection.request("GET", f"/token/artifact/text?path={traversal_path}")
+ response = connection.getresponse()
+
+ assert response.status == 403
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
+
+
+def test_artifact_handler_rejects_file_url_paths_even_inside_allowed_roots(tmp_path) -> None:
+ artifact = tmp_path / "artifact.txt"
+ artifact.write_text("secret")
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(tmp_path.resolve(),),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ file_url = urllib.parse.quote(f"file://{artifact}", safe="")
+ connection.request("GET", f"/token/artifact/text?path={file_url}")
+ response = connection.getresponse()
+
+ assert response.status == 400
+ assert response.getheader("Referrer-Policy") == "no-referrer"
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
+
+
+def test_artifact_handler_serves_paths_inside_allowed_roots(tmp_path) -> None:
+ artifact = tmp_path / "artifact.txt"
+ artifact.write_text("hello")
+ handler = ui_runtime._artifact_handler_class(
+ artifact_token="token",
+ artifact_roots=(tmp_path.resolve(),),
+ ui_port=8080,
+ )
+ server = ThreadingHTTPServer(("127.0.0.1", 0), handler)
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+
+ try:
+ connection = HTTPConnection("127.0.0.1", server.server_port, timeout=5)
+ connection.request(
+ "GET",
+ f"/token/artifact/text?path={artifact}",
+ headers={"Origin": "http://localhost:8080"},
+ )
+ response = connection.getresponse()
+ body = response.read().decode()
+
+ assert response.status == 200
+ assert response.getheader("Access-Control-Allow-Origin") == "http://localhost:8080"
+ assert response.getheader("Referrer-Policy") == "no-referrer"
+ assert body == "hello"
+ finally:
+ connection.close()
+ server.shutdown()
+ server.server_close()
+ thread.join(timeout=5)
diff --git a/uv.lock b/uv.lock
index 6b49d1321..46badcb9b 100644
--- a/uv.lock
+++ b/uv.lock
@@ -5730,6 +5730,77 @@ dependencies = [
]
[package.optional-dependencies]
+all = [
+ { name = "aioboto3" },
+ { name = "aiofiles" },
+ { name = "aiohttp" },
+ { name = "aioredlock" },
+ { name = "aiosqlite" },
+ { name = "alembic" },
+ { name = "anthropic" },
+ { name = "asyncache" },
+ { name = "asyncpg" },
+ { name = "authlib" },
+ { name = "azure-identity" },
+ { name = "azure-keyvault-secrets" },
+ { name = "azure-storage-blob" },
+ { name = "croniter" },
+ { name = "curlparser" },
+ { name = "email-validator" },
+ { name = "fastapi" },
+ { name = "fastmcp" },
+ { name = "filetype" },
+ { name = "fuzzysearch" },
+ { name = "google-auth" },
+ { name = "google-auth-oauthlib" },
+ { name = "google-cloud-aiplatform" },
+ { name = "greenlet", version = "3.0.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },
+ { name = "greenlet", version = "3.4.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
+ { name = "jinja2" },
+ { name = "json-repair" },
+ { name = "json5" },
+ { name = "jsonschema" },
+ { name = "lark" },
+ { name = "libcst" },
+ { name = "litellm" },
+ { name = "onepassword-sdk" },
+ { name = "openai" },
+ { name = "openai-agents" },
+ { name = "opentelemetry-api" },
+ { name = "pandas" },
+ { name = "pdfplumber" },
+ { name = "pillow" },
+ { name = "playwright", version = "1.46.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },
+ { name = "playwright", version = "1.58.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
+ { name = "posthog" },
+ { name = "psutil" },
+ { name = "psycopg", version = "3.1.18", source = { registry = "https://pypi.org/simple" }, extra = ["binary", "pool"], marker = "python_full_version < '3.13'" },
+ { name = "psycopg", version = "3.2.13", source = { registry = "https://pypi.org/simple" }, extra = ["binary", "pool"], marker = "python_full_version >= '3.13'" },
+ { name = "pyasn1" },
+ { name = "pyjwt", extra = ["crypto"] },
+ { name = "pyotp" },
+ { name = "pypdf" },
+ { name = "python-calamine" },
+ { name = "python-docx" },
+ { name = "python-dotenv" },
+ { name = "python-multipart" },
+ { name = "requests-toolbelt" },
+ { name = "skyvern-ui" },
+ { name = "sqlalchemy", extra = ["mypy"] },
+ { name = "sse-starlette" },
+ { name = "starlette-context" },
+ { name = "tiktoken" },
+ { name = "tldextract" },
+ { name = "toml" },
+ { name = "tornado" },
+ { name = "types-boto3", extra = ["full"] },
+ { name = "types-toml" },
+ { name = "urllib3" },
+ { name = "uvicorn", extra = ["standard"] },
+ { name = "websockets" },
+ { name = "yutori" },
+ { name = "zstandard" },
+]
local = [
{ name = "aioboto3" },
{ name = "aiofiles" },
@@ -5859,6 +5930,9 @@ server = [
{ name = "yutori" },
{ name = "zstandard" },
]
+ui = [
+ { name = "skyvern-ui" },
+]
[package.dev-dependencies]
cloud = [
@@ -5914,142 +5988,212 @@ dev = [
[package.metadata]
requires-dist = [
+ { name = "aioboto3", marker = "extra == 'all'", specifier = ">=14.3.0,<15" },
{ name = "aioboto3", marker = "extra == 'local'", specifier = ">=14.3.0,<15" },
{ name = "aioboto3", marker = "extra == 'server'", specifier = ">=14.3.0,<15" },
+ { name = "aiofiles", marker = "extra == 'all'", specifier = ">=24.1.0,<25" },
{ name = "aiofiles", marker = "extra == 'local'", specifier = ">=24.1.0,<25" },
{ name = "aiofiles", marker = "extra == 'server'", specifier = ">=24.1.0,<25" },
+ { name = "aiohttp", marker = "extra == 'all'", specifier = ">=3.13.4,<4" },
{ name = "aiohttp", marker = "extra == 'local'", specifier = ">=3.13.4,<4" },
{ name = "aiohttp", marker = "extra == 'server'", specifier = ">=3.13.4,<4" },
+ { name = "aioredlock", marker = "extra == 'all'", specifier = ">=0.7.3,<0.8" },
{ name = "aioredlock", marker = "extra == 'server'", specifier = ">=0.7.3,<0.8" },
+ { name = "aiosqlite", marker = "extra == 'all'", specifier = ">=0.21.0,<0.23" },
{ name = "aiosqlite", marker = "extra == 'local'", specifier = ">=0.21.0,<0.23" },
{ name = "aiosqlite", marker = "extra == 'server'", specifier = ">=0.21.0,<0.23" },
+ { name = "alembic", marker = "extra == 'all'", specifier = ">=1.12.1,<2" },
{ name = "alembic", marker = "extra == 'local'", specifier = ">=1.12.1,<2" },
{ name = "alembic", marker = "extra == 'server'", specifier = ">=1.12.1,<2" },
+ { name = "anthropic", marker = "extra == 'all'", specifier = ">=0.97.0,<0.98" },
{ name = "anthropic", marker = "extra == 'local'", specifier = ">=0.97.0,<0.98" },
{ name = "anthropic", marker = "extra == 'server'", specifier = ">=0.97.0,<0.98" },
+ { name = "asyncache", marker = "extra == 'all'", specifier = ">=0.3.1,<0.4" },
{ name = "asyncache", marker = "extra == 'local'", specifier = ">=0.3.1,<0.4" },
{ name = "asyncache", marker = "extra == 'server'", specifier = ">=0.3.1,<0.4" },
+ { name = "asyncpg", marker = "extra == 'all'", specifier = ">=0.30.0,<0.32" },
{ name = "asyncpg", marker = "extra == 'server'", specifier = ">=0.30.0,<0.32" },
+ { name = "authlib", marker = "extra == 'all'", specifier = ">=1.7.1" },
{ name = "authlib", marker = "extra == 'local'", specifier = ">=1.7.1" },
{ name = "authlib", marker = "extra == 'server'", specifier = ">=1.7.1" },
+ { name = "azure-identity", marker = "extra == 'all'", specifier = ">=1.24.0,<2" },
{ name = "azure-identity", marker = "extra == 'local'", specifier = ">=1.24.0,<2" },
{ name = "azure-identity", marker = "extra == 'server'", specifier = ">=1.24.0,<2" },
+ { name = "azure-keyvault-secrets", marker = "extra == 'all'", specifier = ">=4.2.0,<5" },
{ name = "azure-keyvault-secrets", marker = "extra == 'local'", specifier = ">=4.2.0,<5" },
{ name = "azure-keyvault-secrets", marker = "extra == 'server'", specifier = ">=4.2.0,<5" },
+ { name = "azure-storage-blob", marker = "extra == 'all'", specifier = ">=12.26.0" },
{ name = "azure-storage-blob", marker = "extra == 'local'", specifier = ">=12.26.0" },
{ name = "azure-storage-blob", marker = "extra == 'server'", specifier = ">=12.26.0" },
{ name = "cachetools", specifier = ">=5.3.2,<6" },
+ { name = "croniter", marker = "extra == 'all'", specifier = ">=1.3.8,<4" },
{ name = "croniter", marker = "extra == 'local'", specifier = ">=1.3.8,<4" },
{ name = "croniter", marker = "extra == 'server'", specifier = ">=1.3.8,<4" },
+ { name = "curlparser", marker = "extra == 'all'", specifier = ">=0.1.0,<0.2" },
{ name = "curlparser", marker = "extra == 'local'", specifier = ">=0.1.0,<0.2" },
{ name = "curlparser", marker = "extra == 'server'", specifier = ">=0.1.0,<0.2" },
+ { name = "email-validator", marker = "extra == 'all'", specifier = ">=2.2.0,<3" },
{ name = "email-validator", marker = "extra == 'local'", specifier = ">=2.2.0,<3" },
{ name = "email-validator", marker = "extra == 'server'", specifier = ">=2.2.0,<3" },
+ { name = "fastapi", marker = "extra == 'all'", specifier = ">=0.136.1,<0.137" },
{ name = "fastapi", marker = "extra == 'local'", specifier = ">=0.136.1,<0.137" },
{ name = "fastapi", marker = "extra == 'server'", specifier = ">=0.136.1,<0.137" },
+ { name = "fastmcp", marker = "extra == 'all'", specifier = ">=3.2.0,<4" },
{ name = "fastmcp", marker = "extra == 'server'", specifier = ">=3.2.0,<4" },
+ { name = "filetype", marker = "extra == 'all'", specifier = ">=1.2.0,<2" },
{ name = "filetype", marker = "extra == 'local'", specifier = ">=1.2.0,<2" },
{ name = "filetype", marker = "extra == 'server'", specifier = ">=1.2.0,<2" },
+ { name = "fuzzysearch", marker = "extra == 'all'", specifier = ">=0.8,<1" },
{ name = "fuzzysearch", marker = "extra == 'local'", specifier = ">=0.8,<1" },
{ name = "fuzzysearch", marker = "extra == 'server'", specifier = ">=0.8,<1" },
+ { name = "google-auth", marker = "extra == 'all'", specifier = ">=2.49.2,<3" },
{ name = "google-auth", marker = "extra == 'local'", specifier = ">=2.49.2,<3" },
{ name = "google-auth", marker = "extra == 'server'", specifier = ">=2.49.2,<3" },
+ { name = "google-auth-oauthlib", marker = "extra == 'all'", specifier = ">=1.3.1,<2" },
{ name = "google-auth-oauthlib", marker = "extra == 'local'", specifier = ">=1.3.1,<2" },
{ name = "google-auth-oauthlib", marker = "extra == 'server'", specifier = ">=1.3.1,<2" },
+ { name = "google-cloud-aiplatform", marker = "extra == 'all'", specifier = ">=1.149.0,<2" },
{ name = "google-cloud-aiplatform", marker = "extra == 'local'", specifier = ">=1.149.0,<2" },
{ name = "google-cloud-aiplatform", marker = "extra == 'server'", specifier = ">=1.149.0,<2" },
+ { name = "greenlet", marker = "python_full_version == '3.11.*' and extra == 'all'", specifier = "==3.0.3" },
{ name = "greenlet", marker = "python_full_version == '3.11.*' and extra == 'local'", specifier = "==3.0.3" },
{ name = "greenlet", marker = "python_full_version == '3.11.*' and extra == 'server'", specifier = "==3.0.3" },
+ { name = "greenlet", marker = "python_full_version >= '3.12' and python_full_version < '3.14' and extra == 'all'", specifier = ">3.0.3" },
{ name = "greenlet", marker = "python_full_version >= '3.12' and python_full_version < '3.14' and extra == 'local'", specifier = ">3.0.3" },
{ name = "greenlet", marker = "python_full_version >= '3.12' and python_full_version < '3.14' and extra == 'server'", specifier = ">3.0.3" },
{ name = "httpx", extras = ["socks"], specifier = ">=0.27.0" },
+ { name = "jinja2", marker = "extra == 'all'", specifier = ">=3.1.2,<4" },
{ name = "jinja2", marker = "extra == 'local'", specifier = ">=3.1.2,<4" },
{ name = "jinja2", marker = "extra == 'server'", specifier = ">=3.1.2,<4" },
+ { name = "json-repair", marker = "extra == 'all'", specifier = ">=0.59.5,<0.60" },
{ name = "json-repair", marker = "extra == 'local'", specifier = ">=0.59.5,<0.60" },
{ name = "json-repair", marker = "extra == 'server'", specifier = ">=0.59.5,<0.60" },
+ { name = "json5", marker = "extra == 'all'", specifier = ">=0.13.0,<1" },
{ name = "json5", marker = "extra == 'local'", specifier = ">=0.13.0,<1" },
{ name = "json5", marker = "extra == 'server'", specifier = ">=0.13.0,<1" },
+ { name = "jsonschema", marker = "extra == 'all'", specifier = ">=4.23.0" },
{ name = "jsonschema", marker = "extra == 'local'", specifier = ">=4.23.0" },
{ name = "jsonschema", marker = "extra == 'server'", specifier = ">=4.23.0" },
+ { name = "lark", marker = "extra == 'all'", specifier = ">=1.2.2,<2" },
{ name = "lark", marker = "extra == 'local'", specifier = ">=1.2.2,<2" },
{ name = "lark", marker = "extra == 'server'", specifier = ">=1.2.2,<2" },
+ { name = "libcst", marker = "extra == 'all'", specifier = ">=1.8.2,<2" },
{ name = "libcst", marker = "extra == 'local'", specifier = ">=1.8.2,<2" },
{ name = "libcst", marker = "extra == 'server'", specifier = ">=1.8.2,<2" },
+ { name = "litellm", marker = "extra == 'all'", specifier = "==1.83.14" },
{ name = "litellm", marker = "extra == 'local'", specifier = "==1.83.14" },
{ name = "litellm", marker = "extra == 'server'", specifier = "==1.83.14" },
+ { name = "onepassword-sdk", marker = "extra == 'all'", specifier = "==0.4.0" },
{ name = "onepassword-sdk", marker = "extra == 'local'", specifier = "==0.4.0" },
{ name = "onepassword-sdk", marker = "extra == 'server'", specifier = "==0.4.0" },
+ { name = "openai", marker = "extra == 'all'", specifier = ">=1.68.2" },
{ name = "openai", marker = "extra == 'local'", specifier = ">=1.68.2" },
{ name = "openai", marker = "extra == 'server'", specifier = ">=1.68.2" },
+ { name = "openai-agents", marker = "extra == 'all'", specifier = ">=0.10.5,<0.15" },
{ name = "openai-agents", marker = "extra == 'server'", specifier = ">=0.10.5,<0.15" },
+ { name = "opentelemetry-api", marker = "extra == 'all'", specifier = ">=1.41.1,<2" },
{ name = "opentelemetry-api", marker = "extra == 'local'", specifier = ">=1.41.1,<2" },
{ name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.41.1,<2" },
{ name = "orjson", specifier = ">=3.9.10,<4" },
+ { name = "pandas", marker = "extra == 'all'", specifier = ">=2.3.1,<4" },
{ name = "pandas", marker = "extra == 'local'", specifier = ">=2.3.1,<4" },
{ name = "pandas", marker = "extra == 'server'", specifier = ">=2.3.1,<4" },
+ { name = "pdfplumber", marker = "extra == 'all'", specifier = ">=0.11.0,<0.12" },
{ name = "pdfplumber", marker = "extra == 'local'", specifier = ">=0.11.0,<0.12" },
{ name = "pdfplumber", marker = "extra == 'server'", specifier = ">=0.11.0,<0.12" },
+ { name = "pillow", marker = "extra == 'all'", specifier = ">=10.2.0" },
{ name = "pillow", marker = "extra == 'local'", specifier = ">=10.2.0" },
{ name = "pillow", marker = "extra == 'server'", specifier = ">=10.2.0" },
+ { name = "playwright", marker = "python_full_version == '3.11.*' and extra == 'all'", specifier = "==1.46.0" },
{ name = "playwright", marker = "python_full_version == '3.11.*' and extra == 'local'", specifier = "==1.46.0" },
{ name = "playwright", marker = "python_full_version == '3.11.*' and extra == 'server'", specifier = "==1.46.0" },
+ { name = "playwright", marker = "python_full_version >= '3.12' and python_full_version < '3.14' and extra == 'all'", specifier = ">1.46.0" },
{ name = "playwright", marker = "python_full_version >= '3.12' and python_full_version < '3.14' and extra == 'local'", specifier = ">1.46.0" },
{ name = "playwright", marker = "python_full_version >= '3.12' and python_full_version < '3.14' and extra == 'server'", specifier = ">1.46.0" },
+ { name = "posthog", marker = "extra == 'all'", specifier = ">=3.7.0,<4" },
{ name = "posthog", marker = "extra == 'server'", specifier = ">=3.7.0,<4" },
+ { name = "psutil", marker = "extra == 'all'", specifier = ">=7.0.0" },
{ name = "psutil", marker = "extra == 'local'", specifier = ">=7.0.0" },
{ name = "psutil", marker = "extra == 'server'", specifier = ">=7.0.0" },
+ { name = "psycopg", extras = ["binary", "pool"], marker = "python_full_version >= '3.11' and python_full_version < '3.13' and extra == 'all'", specifier = "==3.1.18" },
{ name = "psycopg", extras = ["binary", "pool"], marker = "python_full_version >= '3.11' and python_full_version < '3.13' and extra == 'server'", specifier = "==3.1.18" },
+ { name = "psycopg", extras = ["binary", "pool"], marker = "python_full_version == '3.13.*' and extra == 'all'", specifier = ">=3.2.2,<3.3.0" },
{ name = "psycopg", extras = ["binary", "pool"], marker = "python_full_version == '3.13.*' and extra == 'server'", specifier = ">=3.2.2,<3.3.0" },
+ { name = "pyasn1", marker = "extra == 'all'", specifier = ">=0.6.3" },
{ name = "pyasn1", marker = "extra == 'local'", specifier = ">=0.6.3" },
{ name = "pyasn1", marker = "extra == 'server'", specifier = ">=0.6.3" },
{ name = "pydantic", specifier = ">=2.5.2,<3" },
{ name = "pydantic-settings", specifier = ">=2.1.0,<3" },
+ { name = "pyjwt", extras = ["crypto"], marker = "extra == 'all'", specifier = ">=2.12.0,<3" },
{ name = "pyjwt", extras = ["crypto"], marker = "extra == 'local'", specifier = ">=2.12.0,<3" },
{ name = "pyjwt", extras = ["crypto"], marker = "extra == 'server'", specifier = ">=2.12.0,<3" },
+ { name = "pyotp", marker = "extra == 'all'", specifier = ">=2.9.0,<3" },
{ name = "pyotp", marker = "extra == 'local'", specifier = ">=2.9.0,<3" },
{ name = "pyotp", marker = "extra == 'server'", specifier = ">=2.9.0,<3" },
+ { name = "pypdf", marker = "extra == 'all'", specifier = ">=6.7.5,<7" },
{ name = "pypdf", marker = "extra == 'local'", specifier = ">=6.7.5,<7" },
{ name = "pypdf", marker = "extra == 'server'", specifier = ">=6.7.5,<7" },
+ { name = "python-calamine", marker = "extra == 'all'", specifier = ">=0.6.1" },
{ name = "python-calamine", marker = "extra == 'local'", specifier = ">=0.6.1" },
{ name = "python-calamine", marker = "extra == 'server'", specifier = ">=0.6.1" },
+ { name = "python-docx", marker = "extra == 'all'", specifier = ">=1.1.0" },
{ name = "python-docx", marker = "extra == 'local'", specifier = ">=1.1.0" },
{ name = "python-docx", marker = "extra == 'server'", specifier = ">=1.1.0" },
{ name = "python-dotenv", specifier = ">=1.0.0,<2" },
+ { name = "python-dotenv", marker = "extra == 'all'", specifier = "==1.2.2" },
{ name = "python-dotenv", marker = "extra == 'server'", specifier = "==1.2.2" },
+ { name = "python-multipart", marker = "extra == 'all'", specifier = ">=0.0.27,<1" },
{ name = "python-multipart", marker = "extra == 'local'", specifier = ">=0.0.27,<1" },
{ name = "python-multipart", marker = "extra == 'server'", specifier = ">=0.0.27,<1" },
+ { name = "requests-toolbelt", marker = "extra == 'all'", specifier = ">=1.0.0,<2" },
{ name = "requests-toolbelt", marker = "extra == 'local'", specifier = ">=1.0.0,<2" },
{ name = "requests-toolbelt", marker = "extra == 'server'", specifier = ">=1.0.0,<2" },
{ name = "rich", specifier = ">=13.7.0,<14" },
+ { name = "skyvern-ui", marker = "extra == 'all'", directory = "packages/skyvern-ui" },
+ { name = "skyvern-ui", marker = "extra == 'ui'", directory = "packages/skyvern-ui" },
{ name = "sqlalchemy", marker = "extra == 'local'", specifier = ">=2.0.29,<3" },
+ { name = "sqlalchemy", extras = ["mypy"], marker = "extra == 'all'", specifier = ">=2.0.29,<3" },
{ name = "sqlalchemy", extras = ["mypy"], marker = "extra == 'server'", specifier = ">=2.0.29,<3" },
+ { name = "sse-starlette", marker = "extra == 'all'", specifier = ">=3.4.1,<4" },
{ name = "sse-starlette", marker = "extra == 'local'", specifier = ">=3.4.1,<4" },
{ name = "sse-starlette", marker = "extra == 'server'", specifier = ">=3.4.1,<4" },
+ { name = "starlette-context", marker = "extra == 'all'", specifier = ">=0.3.6,<0.6" },
{ name = "starlette-context", marker = "extra == 'local'", specifier = ">=0.3.6,<0.6" },
{ name = "starlette-context", marker = "extra == 'server'", specifier = ">=0.3.6,<0.6" },
{ name = "structlog", specifier = ">=23.2.0,<24" },
+ { name = "tiktoken", marker = "extra == 'all'", specifier = ">=0.9.0" },
{ name = "tiktoken", marker = "extra == 'local'", specifier = ">=0.9.0" },
{ name = "tiktoken", marker = "extra == 'server'", specifier = ">=0.9.0" },
+ { name = "tldextract", marker = "extra == 'all'", specifier = ">=5.1.2,<6" },
{ name = "tldextract", marker = "extra == 'local'", specifier = ">=5.1.2,<6" },
{ name = "tldextract", marker = "extra == 'server'", specifier = ">=5.1.2,<6" },
+ { name = "toml", marker = "extra == 'all'", specifier = ">=0.10.2,<0.11" },
{ name = "toml", marker = "extra == 'local'", specifier = ">=0.10.2,<0.11" },
{ name = "toml", marker = "extra == 'server'", specifier = ">=0.10.2,<0.11" },
+ { name = "tornado", marker = "extra == 'all'", specifier = ">=6.5.5" },
{ name = "tornado", marker = "extra == 'local'", specifier = ">=6.5.5" },
{ name = "tornado", marker = "extra == 'server'", specifier = ">=6.5.5" },
{ name = "typer", specifier = ">=0.16.0" },
+ { name = "types-boto3", extras = ["full"], marker = "extra == 'all'", specifier = ">=1.38.31,<2" },
{ name = "types-boto3", extras = ["full"], marker = "extra == 'server'", specifier = ">=1.38.31,<2" },
+ { name = "types-toml", marker = "extra == 'all'", specifier = ">=0.10.8.7,<0.11" },
{ name = "types-toml", marker = "extra == 'server'", specifier = ">=0.10.8.7,<0.11" },
+ { name = "urllib3", marker = "extra == 'all'", specifier = ">=2.7.0" },
{ name = "urllib3", marker = "extra == 'local'", specifier = ">=2.7.0" },
{ name = "urllib3", marker = "extra == 'server'", specifier = ">=2.7.0" },
+ { name = "uvicorn", extras = ["standard"], marker = "extra == 'all'", specifier = ">=0.44.0" },
{ name = "uvicorn", extras = ["standard"], marker = "extra == 'server'", specifier = ">=0.44.0" },
+ { name = "websockets", marker = "extra == 'all'", specifier = ">=12.0,<15.1" },
{ name = "websockets", marker = "extra == 'local'", specifier = ">=12.0,<15.1" },
{ name = "websockets", marker = "extra == 'server'", specifier = ">=12.0,<15.1" },
+ { name = "yutori", marker = "extra == 'all'", specifier = ">=0.5.0" },
{ name = "yutori", marker = "extra == 'local'", specifier = ">=0.5.0" },
{ name = "yutori", marker = "extra == 'server'", specifier = ">=0.5.0" },
+ { name = "zstandard", marker = "extra == 'all'", specifier = ">=0.25.0" },
{ name = "zstandard", marker = "extra == 'local'", specifier = ">=0.25.0" },
{ name = "zstandard", marker = "extra == 'server'", specifier = ">=0.25.0" },
]
-provides-extras = ["local", "server"]
+provides-extras = ["local", "server", "ui", "all"]
[package.metadata.requires-dev]
cloud = [
@@ -6104,6 +6248,11 @@ dev = [
{ name = "types-requests", specifier = ">=2.31.0.2,<3" },
]
+[[package]]
+name = "skyvern-ui"
+version = "1.0.36"
+source = { directory = "packages/skyvern-ui" }
+
[[package]]
name = "sniffio"
version = "1.3.1"