diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..9669b0d --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/devcontainers/python:3.13 + +# Install Node.js 20 +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y nodejs + +# Install UV +RUN curl -LsSf https://astral.sh/uv/install.sh | sh \ + && mv /root/.local/bin/uv /usr/local/bin/uv \ + && mv /root/.local/bin/uvx /usr/local/bin/uvx + +# Install Just +RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash - --to /usr/local/bin + +# Set working directory +WORKDIR /workspace + +# Keep container running +CMD ["sleep", "infinity"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..48ea2cf --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,47 @@ +{ + "name": "Clerk Development", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspace", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "configureZshAsDefaultShell": true + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "20" + } + }, + "postCreateCommand": "just setup", + "forwardPorts": [3000, 8000, 5432], + "portsAttributes": { + "3000": { + "label": "Frontend", + "onAutoForward": "notify" + }, + "8000": { + "label": "Backend API", + "onAutoForward": "notify" + }, + "5432": { + "label": "PostgreSQL", + "onAutoForward": "silent" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "charliermarsh.ruff", + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "esbenp.prettier-vscode" + ], + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.analysis.typeCheckingMode": "strict" + } + } + }, + "remoteUser": "vscode" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..a6e596c --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,28 @@ +version: '3.8' + +services: + app: + build: + context: .. + dockerfile: .devcontainer/Dockerfile + volumes: + - ..:/workspace:cached + command: sleep infinity + depends_on: + - db + environment: + - DATABASE_URL=postgresql://clerk:clerk@db:5432/clerk + + db: + image: postgres:15 + environment: + POSTGRES_USER: clerk + POSTGRES_PASSWORD: clerk + POSTGRES_DB: clerk + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: diff --git a/.env.example b/.env.example index a1ab37b..dd56d56 100644 --- a/.env.example +++ b/.env.example @@ -2,90 +2,110 @@ # CLERK Environment Configuration # ============================================================================= -# LLM ACCESS -# ---------- +# ============================================================================= +# REQUIRED VARIABLES +# ============================================================================= + +# LLM Provider (REQUIRED) +# ----------------------- # Your OpenAI API key for running reasoning kits -OPENAI_API_KEY=your_openai_api_key +# Get one at: https://platform.openai.com/api-keys +OPENAI_API_KEY=sk-your-openai-api-key-here -# Secret key for signing session cookies. +# Application (REQUIRED) +# ---------------------- +# Secret key for signing session cookies and security # IMPORTANT: Change this to a random string in production! -CLERK_SESSION_SECRET=clerk-session-secret-change-in-production +# Generate one with: openssl rand -hex 32 +SECRET_KEY=generate-a-random-secret-key-here + +# ============================================================================= +# DATABASE CONFIGURATION +# ============================================================================= +# +# CLERK supports two modes: +# 1. Local mode (default): Kits stored in reasoning_kits/ directory +# 2. Database mode: Uses PostgreSQL via Supabase for multi-user support +# +# For local development without Supabase, leave these empty. +# For production or multi-user setups, configure Supabase below. +# PostgreSQL Connection URL (required for database mode) +# Format: postgresql+asyncpg://user:password@host:port/database +# Example with Supabase pooler: postgresql+asyncpg://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres +DATABASE_URL=postgresql://clerk:clerk@localhost:5432/clerk + +# Direct connection URL for migrations (optional, recommended for Supabase) +# Uses port 5432 to bypass connection pooler for DDL operations +DATABASE_URL_DIRECT= # ============================================================================= -# SUPABASE CONFIGURATION +# SUPABASE CONFIGURATION (Optional - for cloud database) # ============================================================================= # Found in Supabase Dashboard > Project Settings > API # -# These variables are required for database operations. -# If not configured, CLERK will fall back to local filesystem mode. +# These enable cloud database features: +# - Centralized storage of reasoning kits +# - Version history for all kits +# - Multi-user support with authentication +# - Binary file support (PDF, XLSX, etc.) +# - Full-text search across resources -# Supabase project URL (required) +# Supabase project URL # Example: https://abcdefghijklmnop.supabase.co -SUPABASE_URL= +SUPABASE_URL=https://your-project.supabase.co -# Supabase anon/public key (required) +# Supabase anon/public key # Used for public read operations and client-side access -SUPABASE_ANON_KEY= +SUPABASE_KEY=your-anon-key -# Supabase service role key (optional, but recommended) +# Supabase service role key # Used for admin operations like creating storage buckets and running migrations # Keep this secret! Never expose in client-side code. -SUPABASE_SERVICE_ROLE_KEY= - +SUPABASE_SERVICE_KEY=your-service-key # ============================================================================= -# DATABASE CONNECTION +# OPTIONAL VARIABLES # ============================================================================= -# Found in Supabase Dashboard > Project Settings > Database > Connection string -# -# Use the "URI" format and replace [YOUR-PASSWORD] with your database password. -# IMPORTANT: Use the asyncpg driver prefix: postgresql+asyncpg:// - -# Connection pooler URL (recommended for normal operations) -# Port 6543 uses the Supabase connection pooler (PgBouncer) -# Example: postgresql+asyncpg://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres -DATABASE_URL= - -# Direct connection URL (recommended for migrations) -# Port 5432 connects directly to PostgreSQL, bypassing the pooler -# Required for schema changes and DDL operations -# Example: postgresql+asyncpg://postgres.[ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgres -DATABASE_URL_DIRECT= +# Application Settings +# -------------------- +# Log level: debug, info, warning, error +LOG_LEVEL=info + +# Session cookie name +CLERK_SESSION_SECRET=clerk-session-secret-change-in-production + +# Frontend Configuration +# ---------------------- +# API URL for frontend to connect to backend +# Change if backend runs on different port +VITE_API_URL=http://localhost:8000 + +# Test Credentials (for development only) +# --------------------------------------- +CLERK_EMAIL= +CLERK_PASSWORD= # ============================================================================= -# USAGE NOTES +# QUICK START # ============================================================================= # -# GETTING STARTED: -# 1. Copy this file to .env: cp .env.example .env -# 2. Fill in your OpenAI API key -# 3. (Optional) Add Supabase credentials for cloud database support +# 1. Copy this file to .env: +# cp .env.example .env # -# LOCAL MODE: -# If Supabase is not configured, CLERK operates in local-only mode: -# - Reasoning kits are stored in the reasoning_kits/ directory -# - Evaluations are saved as JSON files -# - No sync between machines +# 2. Edit .env and set your OpenAI API key (REQUIRED): +# OPENAI_API_KEY=sk-... # -# DATABASE MODE (with Supabase): -# With Supabase configured, CLERK provides: -# - Centralized storage of reasoning kits -# - Version history for all kits -# - Multi-user support with authentication -# - Binary file support (PDF, XLSX, etc.) -# - Full-text search across resources -# - Execution run tracking and analytics +# 3. Generate a secret key: +# openssl rand -hex 32 # -# SETUP COMMANDS: -# clerk db setup # Run migrations and create storage bucket -# clerk db status # Check migration status -# clerk sync list # Compare local vs database kits -# clerk sync push X # Push local kit X to database -# clerk sync pull X # Pull kit X from database to local +# 4. (Optional) Add Supabase credentials for database mode +# +# 5. Run setup: +# ./scripts/setup.sh +# +# 6. Start development server: +# npm run dev # # ============================================================================= -#CREDENTIALS FOR TESTING PURPOSES -CLERK_EMAIL= -CLERK_PASSWORD= \ No newline at end of file diff --git a/.github/GOOD_FIRST_ISSUES.md b/.github/GOOD_FIRST_ISSUES.md new file mode 100644 index 0000000..4fa0c4b --- /dev/null +++ b/.github/GOOD_FIRST_ISSUES.md @@ -0,0 +1,56 @@ +# Good First Issues + +Templates for initial "good first issue" labels. Create these in GitHub Issues. + +## Issue 1: Documentation Improvements + +**Title:** Improve README with better installation examples + +**Labels:** `good first issue`, `documentation` + +**Description:** + +``` +The current README installation section could be clearer for new contributors. + +### Task +- Review the README.md installation instructions +- Add more explicit examples for common setups +- Ensure the 5-minute setup claim is accurate + +### Acceptance Criteria +- [ ] Installation instructions tested on clean system +- [ ] Examples cover macOS and Linux +- [ ] Troubleshooting section added for common issues +- [ ] Instructions work with the devcontainer setup +``` + +## Issue 2: Add Test Coverage + +**Title:** Add tests for reasoning kit loader + +**Labels:** `good first issue`, `testing` + +**Description:** + +``` +The reasoning kit loader (`packages/clerk/src/openclerk/loader.py`) needs better test coverage. + +### Task +- Add unit tests for `load_reasoning_kit()` function +- Test edge cases: missing files, invalid JSON, malformed kits +- Aim for >80% coverage on loader module + +### Acceptance Criteria +- [ ] Tests exist in `packages/clerk/tests/test_loader.py` +- [ ] All happy paths tested +- [ ] Edge cases (FileNotFoundError, JSONDecodeError) tested +- [ ] Coverage report shows >80% for loader.py +``` + +## Creating These Issues + +1. Go to https://github.com/openclerk/clerk/issues/new +2. Copy title and description from above +3. Add labels: `good first issue` plus relevant category label +4. Repeat for all 3 issues diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..8f87438 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,63 @@ +name: "Bug Report" +description: "Create a report to help us improve" +title: "[Bug]: " +labels: ["bug"] + +body: + - type: textarea + id: description + attributes: + label: Description + description: A clear description of the bug + placeholder: Describe what you observed... + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: Reproduction Steps + description: Steps to reproduce the behavior + placeholder: | + 1. Go to '...' + 2. Click on '...' + 3. Scroll down to '...' + 4. See error + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: What you expected to happen + placeholder: Describe what you expected... + validations: + required: true + + - type: textarea + id: actual + attributes: + label: Actual Behavior + description: What actually happened + placeholder: Describe what actually occurred... + validations: + required: true + + - type: input + id: environment + attributes: + label: Environment + description: Your environment details (OS, Python version, Clerk version) + placeholder: macOS 14, Python 3.13, Clerk 0.1.0 + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Additional Context + description: Screenshots, logs, or other context + placeholder: Add any other context about the problem here... + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..484dffb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,50 @@ +name: "Feature Request" +description: "Suggest an idea for this project" +title: "[Feature]: " +labels: ["enhancement"] + +body: + - type: textarea + id: description + attributes: + label: Description + description: Clear description of the feature + placeholder: Describe the feature you'd like to see... + validations: + required: true + + - type: textarea + id: problem + attributes: + label: Problem / Use Case + description: What problem does this solve? + placeholder: Explain the use case or problem this feature addresses... + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: How should this work? + placeholder: Describe how you envision this feature working... + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives Considered + description: Alternative solutions you've considered + placeholder: Describe any alternative approaches you've thought about... + validations: + required: false + + - type: textarea + id: context + attributes: + label: Additional Context + description: Screenshots, mockups, or references + placeholder: Add any other context, mockups, or examples here... + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..9ef40b3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +## Description + + + +## Related Issue + + +Fixes # + +## Checklist + +- [ ] Tests pass (`just test`) +- [ ] Code follows style (`just lint`) +- [ ] Documentation updated (if needed) +- [ ] Related issue linked + +## Additional Notes + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2828c98 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "0.4.x" + - uses: extractions/setup-just@v2 + - name: Run lint + run: just lint + + test: + strategy: + matrix: + python-version: ["3.13"] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v3 + with: + version: "0.4.x" + - uses: extractions/setup-just@v2 + - name: Run tests + run: just test diff --git a/.gitignore b/.gitignore index de9d5f8..c97cac9 100644 --- a/.gitignore +++ b/.gitignore @@ -208,4 +208,15 @@ __marimo__/ # AI Coding .github/workflows/opencode.yml -.opencode \ No newline at end of file +.opencode +.planning + +# Fonts +fonts/ + +# MCP Stuff +tmp_airtable_mcp/ +tmp_mcp_030/ + +# Apple +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1083d31 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.0 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + additional_dependencies: [] + exclude: "^(main\\.py|test_.*\\.py|clean_kit\\.py|examples/)" diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..38703f1 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,9 @@ +{ + "recommendations": [ + "ms-python.python", + "charliermarsh.ruff", + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..be5c7e0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,48 @@ +{ + "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", + "python.analysis.typeCheckingMode": "strict", + "ruff.organizeImports": true, + "ruff.fixAll": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.ruff": "explicit", + "source.organizeImports.ruff": "explicit" + }, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "files.exclude": { + "**/__pycache__": true, + "**/.pytest_cache": true, + "**/.mypy_cache": true, + "**/.ruff_cache": true, + "**/.venv": true, + "**/node_modules": true + }, + "search.exclude": { + "**/__pycache__": true, + "**/.pytest_cache": true, + "**/.mypy_cache": true, + "**/.ruff_cache": true, + "**/.venv": true, + "**/node_modules": true, + "**/dist": true + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0bed4cb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- Initial project foundation with documentation and tooling +- MIT License +- CONTRIBUTING.md with development setup instructions +- CODE_OF_CONDUCT.md following Contributor Covenant v2.1 +- UV workspace configuration for Python dependency management +- Ruff configuration for linting and formatting +- pytest configuration with coverage reporting +- mypy configuration for type checking +- Just task runner configuration +- Dev container for zero-setup contributions +- VS Code settings and extensions diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a301cfe --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,172 @@ + +## Project + +**Clerk — Developer Experience Enhancement** + +Clerk is a Python framework for multi-step LLM reasoning workflows with a React frontend. This project aims to transform Clerk from a solo-developed tool into an open-source project with excellent developer experience, comprehensive onboarding, and flexible deployment options (self-hosted or embedded in existing applications). + +**Core Value:** Developers can set up Clerk in under 5 minutes and contribute meaningfully in under 1 hour, regardless of whether they're self-hosting, embedding, or contributing to the core framework. + +### Constraints + +- **Tech Stack**: Python 3.13+, UV, LangChain/LangGraph, React 19, TypeScript, Tailwind +- **Timeline**: Aggressive — open source launch target +- **Dependencies**: Must remain compatible with existing LangChain ecosystem +- **Compatibility**: Existing reasoning kits must continue to work +- **Documentation**: Must be excellent from day one (no "docs coming soon") + + + +## Technology Stack + +## Executive Summary +## Recommended Stack +### Core Tooling (Required) +| Technology | Version | Purpose | Why Recommended | Confidence | +|------------|---------|---------|-----------------|------------| +| **UV** | 0.6.x | Package manager, virtual env, Python version management | Replaces pip/pip-tools/poetry/pipx with 10-100x faster resolution; universal lockfile support; Astral-backed with rapid development | HIGH | +| **Ruff** | 0.11.x | Linter and formatter | Replaces Flake8, Black, isort, pydocstyle with 10-100x speed; 800+ built-in rules; used by FastAPI, Pandas, Airflow | HIGH | +| **pytest** | 8.3.x | Testing framework | Industry standard; 1300+ plugins; superior failure reporting; native asyncio support via pytest-asyncio | HIGH | +| **mypy** | 1.15.x+ | Static type checking | De facto standard for Python type checking; gradual typing support; strong ecosystem compatibility | HIGH | +### Development Workflow (Required) +| Technology | Version | Purpose | Why Recommended | Confidence | +|------------|---------|---------|-----------------|------------| +| **pre-commit** | 4.x | Git hooks framework | Multi-language hook management; auto-installs dependencies; CI integration; prevents bad commits | HIGH | +| **commitizen** | 4.x | Conventional commits, changelog, versioning | Python-native; generates changelogs; enforces commit standards; integrates with pre-commit | HIGH | +| **Just** | 1.x | Task runner | Modern Make alternative; cross-platform; shell-agnostic; `.env` support; self-documenting | HIGH | +| **coverage.py** | 7.6.x+ | Code coverage measurement | Standard coverage tool; pytest integration; HTML/XML/LCOV reports; branch coverage | HIGH | +### Documentation (Required) +| Technology | Version | Purpose | Why Recommended | Confidence | +|------------|---------|---------|-----------------|------------| +| **MkDocs** | 1.6.x+ | Static site generator for docs | Markdown-based; Material theme available; plugin ecosystem; GitHub Pages deployment | HIGH | +| **MkDocs Material** | 9.x | Documentation theme | Beautiful, responsive design; search; dark mode; versioning support | HIGH | +| **mike** | 2.x | Versioned documentation | Deploy multiple doc versions; essential for library projects | MEDIUM | +### CI/CD (Required) +| Technology | Version/Config | Purpose | Why Recommended | Confidence | +|------------|----------------|---------|-----------------|------------| +| **GitHub Actions** | Latest | CI/CD automation | Native GitHub integration; free for open source; matrix builds; OIDC for PyPI | HIGH | +| **semantic-release** | 24.x | Automated versioning/releases | Conventional commit-based; automatic changelog; GitHub releases; PyPI publishing | HIGH | +### Supporting Libraries (Recommended) +| Library | Version | Purpose | When to Use | +|---------|---------|---------|-------------| +| **pytest-asyncio** | 0.25.x+ | Async test support | Required for testing async SQLAlchemy, LangGraph workflows | +| **pytest-cov** | 6.x | Coverage integration | Convenient coverage with pytest; may use coverage.py directly instead | +| **httpx** | 0.28.x+ | HTTP client for tests | Modern requests alternative; async support; type hints | +| **respx** | 0.22.x+ | HTTPX mocking | Mock HTTP calls in tests; essential for external API testing | +| **factory-boy** | 3.3.x+ | Test data factories | Create test fixtures; SQLAlchemy integration available | +| **freezegun** | 1.5.x+ | Time mocking | Freeze time in tests; useful for timestamp-dependent workflows | +## Installation +### One-Time Setup (Project Initialization) +# Install UV (if not already installed) +# Install global development tools +# Install pre-commit hooks manager +### Project Dependencies (pyproject.toml) +### Quick Install Commands +# Install all dependencies including dev group +# Install only production dependencies +# Run linting +# Run type checking +# Run tests +# Run all quality checks +## Configuration Files +### pyproject.toml (Centralized Config) +### .pre-commit-config.yaml +### justfile +# Default recipe - show available commands +# Install development environment +# Run all quality checks +# Run linting +# Fix auto-fixable linting issues +# Run type checking +# Run tests +# Run tests with coverage +# Serve documentation locally +# Build documentation +# Deploy documentation (maintainers only) +# Clean build artifacts +## Alternatives Considered +| Category | Recommended | Alternative | When Alternative Makes Sense | +|----------|-------------|-------------|------------------------------| +| Package Manager | **UV** | Poetry | Poetry has wider ecosystem support; use if team already familiar | +| Linter/Formatter | **Ruff** | Black + Flake8 | If you need plugins not yet in Ruff (rare) | +| Type Checker | **mypy** | pyright | Pyright is faster; use for very large codebases | +| Task Runner | **Just** | Make | Make is ubiquitous; use if avoiding new dependencies | +| Task Runner | **Just** | Invoke (Python) | Use Invoke for complex Python-based task logic | +| Commit Standards | **commitizen** | commitlint (JS) | commitlint has more rules; use if already in JS ecosystem | +| Docs | **MkDocs** | Sphinx | Sphinx is better for API docs; use for complex reference docs | +| CI/CD | **GitHub Actions** | GitLab CI | Use GitLab CI if self-hosting on GitLab | +## What NOT to Use +| Avoid | Why Not | Use Instead | +|-------|---------|-------------| +| **pip + requirements.txt** | No lockfile, slow resolution, no workspace support | UV with uv.lock | +| **setup.py** | Deprecated; use pyproject.toml | pyproject.toml with hatchling/uv build | +| **Black** (standalone) | Ruff's formatter is Black-compatible and 10x faster | Ruff format | +| **Flake8** | Ruff replaces all plugins with native rules | Ruff lint | +| **isort** | Ruff handles import sorting natively | Ruff organize imports | +| **pylint** | Slower, more false positives; Ruff covers most rules | Ruff + mypy | +| **tox** | UV environments are faster and simpler | UV workspaces + GitHub Actions matrix | +| **Makefile** | Windows compatibility issues, tab sensitivity | Just | +| **setuptools** | Complex, legacy baggage | hatchling (PEP 517) or uv build | +## Version Compatibility Matrix +| Tool | Python 3.13 | Python 3.14 (dev) | Notes | +|------|-------------|-------------------|-------| +| UV 0.6.x | ✅ | ✅ | Full support | +| Ruff 0.11.x | ✅ | ✅ | Target py313 works | +| pytest 8.3.x | ✅ | ✅ | asyncio support confirmed | +| mypy 1.15.x | ✅ | ⚠️ | Check for 3.14 support | +| pre-commit 4.x | ✅ | ✅ | No issues | +| commitizen 4.x | ✅ | ✅ | Python 3.10+ required | +## Sources +| Source | URL | Confidence | Notes | +|--------|-----|------------|-------| +| Ruff Docs | https://docs.astral.sh/ruff/ | HIGH | Official; v0.11.x current | +| UV Docs | https://docs.astral.sh/uv/ | HIGH | Official; v0.6.x current | +| pytest Docs | https://docs.pytest.org/ | HIGH | Official; v8.3.x current | +| mypy Docs | https://mypy.readthedocs.io/ | HIGH | Official; v1.15.x current | +| pre-commit Docs | https://pre-commit.com/ | HIGH | Official; v4.x current | +| commitizen Docs | https://commitizen-tools.github.io/commitizen/ | HIGH | Official; v4.x current | +| Just GitHub | https://github.com/casey/just | HIGH | Official; v1.x stable | +| Coverage.py Docs | https://coverage.readthedocs.io/ | HIGH | Official; v7.6.x current | +| MkDocs | https://www.mkdocs.org/ | HIGH | Official; v1.6.x current | +| Hatch PyPI | https://pypi.org/project/hatch/ | MEDIUM | Verified versions | +## Roadmap Implications +- UV is already partially in use — expand to full project management +- Ruff replaces any existing linting (Flake8, Black) +- Just provides contributor-friendly task commands +- MkDocs Material provides professional documentation site +- Semantic-release automates versioning based on conventional commits + + + +## Conventions + +Conventions not yet established. Will populate as patterns emerge during development. + + + +## Architecture + +Architecture not yet mapped. Follow existing patterns found in the codebase. + + + +## GSD Workflow Enforcement + +Before using Edit, Write, or other file-changing tools, start work through a GSD command so planning artifacts and execution context stay in sync. + +Use these entry points: +- `/gsd:quick` for small fixes, doc updates, and ad-hoc tasks +- `/gsd:debug` for investigation and bug fixing +- `/gsd:execute-phase` for planned phase work + +Do not make direct repo edits outside a GSD workflow unless the user explicitly asks to bypass it. + + + + + +## Developer Profile + +> Profile not yet configured. Run `/gsd:profile-user` to generate your developer profile. +> This section is managed by `generate-claude-profile` -- do not edit manually. + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..565b3df --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,132 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +coc@openclerk.dev. All complaints will be reviewed and investigated +promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bdab842 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,102 @@ +# Contributing to OpenClerk + +Thank you for your interest in contributing to OpenClerk! This document provides guidelines and instructions for contributing. + +## Code of Conduct + +This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. + +## Development Setup + +### Quick Start (5 minutes) + +1. **Prerequisites**: Python 3.13+, Node.js 20+, UV, Just +2. **Clone**: `git clone https://github.com/simonweigold/clerk.git` +3. **Setup**: `just setup` +4. **Verify**: `just test` + +See [detailed setup instructions](docs/contributing/setup.md) for platform-specific guidance and troubleshooting. + +### Dev Container Option + +For zero local setup, use the dev container: +- VS Code: "Reopen in Container" +- GitHub: Click "Code" → "Codespaces" → "Create codespace" + +### Pre-commit Hooks + +We use pre-commit to run linting and type checks before each commit. + +1. Install pre-commit: + ```bash + uv pip install pre-commit + ``` + +2. Install the hooks: + ```bash + pre-commit install + ``` + +3. (Optional) Run on all files once: + ```bash + pre-commit run --all-files + ``` + +The hooks will now run automatically on every commit, checking: +- Ruff linting and formatting +- mypy type checking + +## Development Workflow + +1. **Create a branch**: `git checkout -b feature/your-feature-name` +2. **Make changes**: Edit code following our style guidelines +3. **Run tests**: `just test` +4. **Run linting**: `just lint` +5. **Commit**: Use clear, descriptive commit messages +6. **Push**: `git push origin feature/your-feature-name` +7. **Pull Request**: Submit PR with description of changes + +## Code Style + +We use automated tools to maintain code quality: + +- **Python**: Ruff for linting/formatting, mypy for type checking +- **TypeScript/JavaScript**: ESLint and Prettier +- **Line length**: 100 characters +- **Import style**: Sorted by Ruff + +Run `just format` to auto-format code before committing. + +## Testing + +All contributions should include tests: + +```bash +# Run all tests +just test + +# Run specific test file +pytest test_specific.py + +# Run with coverage +pytest --cov=src/openclerk +``` + +## Pull Request Process + +1. Update documentation if your changes affect usage +2. Add tests for new functionality +3. Ensure all tests pass (`just test`) +4. Ensure linting passes (`just lint`) +5. Update CHANGELOG.md with your changes under [Unreleased] +6. Link any related issues in your PR description + +## Questions? + +- Open an issue for bugs or feature requests +- Check existing issues and discussions before creating new ones +- Join our community discussions + +## License + +By contributing, you agree that your contributions will be licensed under the MIT License. diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..6ef78d9 --- /dev/null +++ b/Justfile @@ -0,0 +1,54 @@ +set dotenv-load + +# Default recipe - list all commands +default: + @just --list + +# Setup development environment +setup: + #!/usr/bin/env bash + echo "Setting up Clerk development environment..." + uv sync + cd packages/clerk && uv pip install -e ".[dev]" + cd apps/website && npm install + echo "Setup complete! Run 'just dev' to start development." + +# Run all tests with coverage +test: + cd packages/clerk && uv run --extra dev pytest --cov=src/openclerk --cov-report=term-missing; \ + exit_code=$?; [ $exit_code -eq 5 ] && exit 0 || exit $exit_code + +# Run linting (Ruff + mypy) +lint: + cd packages/clerk && uv run --extra dev ruff check src/ tests/ + cd packages/clerk && uv run --extra dev mypy src/ + +# Format all code +format: + cd packages/clerk && uv run --extra dev ruff format src/ tests/ + +# Start full development environment +dev: + #!/usr/bin/env bash + trap "kill %1 %2 2>/dev/null || true" EXIT + just dev-backend & + just dev-frontend & + wait + +# Start backend only +dev-backend: + cd packages/clerk && uv run clerk web --host 0.0.0.0 + +# Start frontend only +dev-frontend: + cd apps/website && npm run dev + +# Clean build artifacts +clean: + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true + find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true + find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true + find . -type d -name node_modules -path "*/website/*" -exec rm -rf {} + 2>/dev/null || true + find . -type d -name dist -exec rm -rf {} + 2>/dev/null || true + echo "Cleaned build artifacts" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2b17602 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 OpenClerk Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 12d8073..86be4f8 100644 --- a/README.md +++ b/README.md @@ -1,177 +1,48 @@ -# CLERK -Community Library of Executable Reasoning Kits +# OpenClerk -## Setup +[![PyPI](https://img.shields.io/pypi/v/openclerk.svg)](https://pypi.org/project/openclerk/) +[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) -1. Install dependencies with UV: -```bash -uv sync -``` - -2. Create a `.env` file with your OpenAI API key: -```bash -cp .env.example .env -# Edit .env and add your OPENAI_API_KEY -``` - -## Usage - -### CLI Commands - -List available reasoning kits: -```bash -uv run clerk list -``` +> Community Library of Executable Reasoning Kits -Show info about a reasoning kit: -```bash -uv run clerk info demo -``` - -Run a reasoning kit: -```bash -uv run clerk run demo -``` - -Run web app: -(optional): -```bash -npx tailwindcss@3 -i src/clerk/web/static/css/tailwind.input.css -o src/clerk/web/static/css/tailwind.built.css --minify -``` -Mandatory: -```bash -uv run clerk web -``` +Clerk is a Python framework for multi-step LLM reasoning workflows with a React frontend. Define and execute modular, reusable reasoning workflows using Large Language Models. -### Programmatic Usage +## Quickstart ```python -from clerk.loader import load_reasoning_kit -from clerk.graph import run_reasoning_kit +from openclerk.loader import load_reasoning_kit +from openclerk.graph import run_reasoning_kit kit = load_reasoning_kit("reasoning_kits/demo") outputs = run_reasoning_kit(kit) ``` -## Creating New Reasoning Kits +## Installation -1. Create a new directory under `reasoning_kits/` -2. Add resource files named `resource_1.txt`, `resource_2.csv`, etc. -3. Add instruction files named `instruction_1.txt`, `instruction_2.txt`, etc. - -## Reasoning Kit Structure - -A reasoning kit is a directory with auto-discovered files: - -``` -reasoning_kits/ -└── my_kit/ - ├── resource_1.txt # Referenced as {resource_1} in prompts - ├── resource_2.csv # Referenced as {resource_2} in prompts - ├── instruction_1.txt # First workflow step, output: {workflow_1} - ├── instruction_2.txt # Second workflow step, output: {workflow_2} - └── instruction_3.txt # Third workflow step, output: {workflow_3} +```bash +pip install openclerk ``` -### Resources -- Files matching `resource_*.txt` or `resource_*.csv` are loaded as resources -- The resource ID is derived from the filename (e.g., `resource_1.txt` → `{resource_1}`) - -### Workflow Steps -- Files matching `instruction_*.txt` define workflow steps -- Steps are executed in numerical order (1, 2, 3, ...) -- Each step's output is stored as `{workflow_N}` for use in later steps - -### Placeholders -In instruction files, use placeholders to reference: -- Resources: `{resource_1}`, `{resource_2}`, etc. -- Previous outputs: `{workflow_1}`, `{workflow_2}`, etc. - -Example `instruction_2.txt`: -``` -Here is some context: {resource_1} -Based on the previous analysis: {workflow_1} -Please provide a summary. +Or from source: +```bash +git clone https://github.com/simonweigold/clerk.git && cd clerk +just setup ``` -The abstract overview of a reasoning kit: +## Usage +```bash +clerk list # List reasoning kits +clerk run demo # Run a kit +clerk web # Start web UI ``` -{ - "resources": { - "1": { - "content": "Full text", - "link": "", - "resource_id": "resource_1" - }, - "2": { - "content": "", - "link": "https://blob-storage.cloud-provider.com/file.pdf", - "resource_id": "resource_2" - } - } - "workflow": { - "1": { - "type": "instruction", - "prompt": "Look at this document:\n{resource_1}\nand classify it", - "evaluation": "", - "output_id": "workflow_1" - }, - "2": { - "type": "instruction", - "prompt": "Look up a definition for this classification:\n{workflow_1}\nfrom this resource:\n{resource_2}", - "evalaution": "", - "output_id": "workflow_2" - }, - "3": { - "type": "instruction", - "prompt": "Generate the final answer with this context information:\n{resource_1}\n{workflow_1}\n{workflow_2}", - "evaluation": "", - "output_id": "workflow_3" - } - } -} -``` - -## Workflow -The workflow runs chronologically. Steps are executed in order (1, 2, 3, ...) with each step's output available to subsequent steps via placeholders. - -## MCP -CLERK can be connected to other LLMs via MCP. The LLM can create new Reasoning Kits, edit and execute them. In order to be able to do this, it needs to be instructed via prompts. - -## General Tasks -- [x] Langchain logic, which executes all steps from the workflow -- [x] After final event, present all results back to user -- [x] For evaluation steps, interrupt logic and ask for user feedback -- [x] Database layer, which centralizes the storage for reasoning kits -- [x] Reasoning Kit definition layer (via terminal) -- [x] UI, which can be launched via `clerk web` - - [x] wraps the Reasoning Kit definition layer in an intuitive way - - [x] allows execution of Kits (including evaluation if desired) -- [ ] Spin up local db for storage (as alternative to Supabase) --> launch with `clerk web --local` -- [ ] MCP logic - - [ ] Log in to Supabase if desired - - [ ] If not: use local db instance -- [ ] New type: resources, workflows, tools! -- [ ] Batch execution mode -- [ ] Docker implementation - -## Tasks (to be implemented another time) -- [ ] change reasoning_kits/demo/resource_1.txt to pdf and add pdf support for resources. -- [ ] collect some more practical use cases for showcasing - - - - -- I3 allow resources to be a website -- add option to reset password for supabase when signing in -- when user with mail address already exists in supabase tell the user +## Documentation -- allow resizing of text input fields when editing workflow steps +- [User Guide](docs/user-guide/) - Getting started +- [Integration Guide](docs/integration/) - Embedding Clerk +- [Contributing](CONTRIBUTING.md) - Development setup -- when executing a kit, allow user to edit an output (important in case it is referenced in future steps) -- when executing a kit, add option to view entire prompt +## License -- save workflow executions to db and allow user to access them again even after quitting -- add download results option +[MIT License](LICENSE) diff --git a/frontend/.gitignore b/apps/website/.gitignore similarity index 100% rename from frontend/.gitignore rename to apps/website/.gitignore diff --git a/apps/website/Dockerfile b/apps/website/Dockerfile new file mode 100644 index 0000000..c588fca --- /dev/null +++ b/apps/website/Dockerfile @@ -0,0 +1,35 @@ +# Production Dockerfile for Clerk Frontend +# Multi-stage build: build React app, then serve with nginx + +# Build stage +FROM node:20-alpine AS builder + +# Set working directory +WORKDIR /app + +# Copy package files for dependency installation +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm ci + +# Copy source files +COPY . . + +# Build the React application +RUN npm run build + +# Production stage +FROM nginx:alpine + +# Copy built assets from builder stage +COPY --from=builder /app/dist /usr/share/nginx/html + +# Copy nginx configuration +COPY docker/nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 + +# Start nginx in foreground +CMD ["nginx", "-g", "daemon off;"] diff --git a/apps/website/README.md b/apps/website/README.md new file mode 100644 index 0000000..5192c07 --- /dev/null +++ b/apps/website/README.md @@ -0,0 +1,98 @@ +# OpenClerk Website + +The official website for OpenClerk - built with React, TypeScript, and Vite. + +## Overview + +This is the website application for openclerk.dev, providing: + +- Documentation and guides +- Interactive reasoning kit browser +- Kit execution interface +- User authentication and settings + +## Tech Stack + +- **Framework**: React 19 + TypeScript +- **Build Tool**: Vite +- **Styling**: Tailwind CSS +- **Routing**: React Router +- **UI Components**: Custom components with Tailwind + +## Development + +### Prerequisites + +- Node.js 20+ +- npm or yarn + +### Setup + +```bash +cd apps/website +npm install +``` + +### Development Server + +```bash +npm run dev +``` + +This starts the development server at `http://localhost:5173`. + +### Build + +```bash +npm run build +``` + +This creates a production build in the `dist/` directory. + +### Preview Build + +```bash +npm run preview +``` + +Preview the production build locally. + +### Linting + +```bash +npm run lint +``` + +## Project Structure + +``` +apps/website/ +├── src/ +│ ├── components/ # Reusable UI components +│ ├── pages/ # Route/page components +│ ├── hooks/ # Custom React hooks +│ ├── lib/ # Utilities and API clients +│ ├── App.tsx # Main app component with routing +│ └── main.tsx # Entry point +├── public/ # Static assets +├── index.html # HTML template +└── vite.config.ts # Vite configuration +``` + +## Environment Variables + +Create a `.env` file in `apps/website/` with: + +``` +VITE_API_URL=http://localhost:8000 +``` + +## Deployment + +The website is deployed to openclerk.dev via [deployment platform]. + +## Links + +- [Live Site](https://openclerk.dev) +- [Main Repository](../../README.md) +- [Python Package](../../packages/clerk/README.md) diff --git a/frontend/eslint.config.js b/apps/website/eslint.config.js similarity index 100% rename from frontend/eslint.config.js rename to apps/website/eslint.config.js diff --git a/frontend/index.html b/apps/website/index.html similarity index 100% rename from frontend/index.html rename to apps/website/index.html diff --git a/frontend/package-lock.json b/apps/website/package-lock.json similarity index 88% rename from frontend/package-lock.json rename to apps/website/package-lock.json index 4733770..f3ae98f 100644 --- a/frontend/package-lock.json +++ b/apps/website/package-lock.json @@ -1,11 +1,11 @@ { - "name": "frontend", + "name": "website", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "frontend", + "name": "website", "version": "0.0.0", "dependencies": { "@tailwindcss/typography": "^0.5.19", @@ -220,23 +220,23 @@ } }, "node_modules/@babel/helpers": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", - "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.28.6", - "@babel/types": "^7.28.6" + "@babel/types": "^7.29.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", - "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", "dev": true, "license": "MIT", "dependencies": { @@ -330,9 +330,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", - "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.4.tgz", + "integrity": "sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==", "cpu": [ "ppc64" ], @@ -347,9 +347,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", - "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.4.tgz", + "integrity": "sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==", "cpu": [ "arm" ], @@ -364,9 +364,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", - "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.4.tgz", + "integrity": "sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==", "cpu": [ "arm64" ], @@ -381,9 +381,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", - "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.4.tgz", + "integrity": "sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==", "cpu": [ "x64" ], @@ -398,9 +398,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", - "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.4.tgz", + "integrity": "sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==", "cpu": [ "arm64" ], @@ -415,9 +415,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", - "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.4.tgz", + "integrity": "sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==", "cpu": [ "x64" ], @@ -432,9 +432,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", - "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.4.tgz", + "integrity": "sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==", "cpu": [ "arm64" ], @@ -449,9 +449,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", - "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.4.tgz", + "integrity": "sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==", "cpu": [ "x64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", - "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.4.tgz", + "integrity": "sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==", "cpu": [ "arm" ], @@ -483,9 +483,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", - "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.4.tgz", + "integrity": "sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==", "cpu": [ "arm64" ], @@ -500,9 +500,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", - "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.4.tgz", + "integrity": "sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==", "cpu": [ "ia32" ], @@ -517,9 +517,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", - "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.4.tgz", + "integrity": "sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==", "cpu": [ "loong64" ], @@ -534,9 +534,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", - "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.4.tgz", + "integrity": "sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==", "cpu": [ "mips64el" ], @@ -551,9 +551,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", - "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.4.tgz", + "integrity": "sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==", "cpu": [ "ppc64" ], @@ -568,9 +568,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", - "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.4.tgz", + "integrity": "sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==", "cpu": [ "riscv64" ], @@ -585,9 +585,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", - "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.4.tgz", + "integrity": "sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==", "cpu": [ "s390x" ], @@ -602,9 +602,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", - "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.4.tgz", + "integrity": "sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==", "cpu": [ "x64" ], @@ -619,9 +619,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", - "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.4.tgz", + "integrity": "sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==", "cpu": [ "arm64" ], @@ -636,9 +636,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", - "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.4.tgz", + "integrity": "sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==", "cpu": [ "x64" ], @@ -653,9 +653,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", - "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.4.tgz", + "integrity": "sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==", "cpu": [ "arm64" ], @@ -670,9 +670,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", - "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.4.tgz", + "integrity": "sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==", "cpu": [ "x64" ], @@ -687,9 +687,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", - "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.4.tgz", + "integrity": "sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==", "cpu": [ "arm64" ], @@ -704,9 +704,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", - "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.4.tgz", + "integrity": "sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==", "cpu": [ "x64" ], @@ -721,9 +721,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", - "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.4.tgz", + "integrity": "sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==", "cpu": [ "arm64" ], @@ -738,9 +738,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", - "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.4.tgz", + "integrity": "sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==", "cpu": [ "ia32" ], @@ -755,9 +755,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", - "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.4.tgz", + "integrity": "sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==", "cpu": [ "x64" ], @@ -814,15 +814,15 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", - "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", - "minimatch": "^3.1.2" + "minimatch": "^3.1.5" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -855,20 +855,20 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", - "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", "dev": true, "license": "MIT", "dependencies": { - "ajv": "^6.12.4", + "ajv": "^6.14.0", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.1", - "minimatch": "^3.1.2", + "minimatch": "^3.1.5", "strip-json-comments": "^3.1.1" }, "engines": { @@ -892,9 +892,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.39.3", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.3.tgz", - "integrity": "sha512-1B1VkCq6FuUNlQvlBYb+1jDu/gV297TIs/OeiaSR9l1H27SVW55ONE1e1Vp16NqP683+xEGzxYtv4XCiDPaQiw==", + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", "dev": true, "license": "MIT", "engines": { @@ -1069,9 +1069,9 @@ "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.58.0.tgz", - "integrity": "sha512-mr0tmS/4FoVk1cnaeN244A/wjvGDNItZKR8hRhnmCzygyRXYtKF5jVDSIILR1U97CTzAYmbgIj/Dukg62ggG5w==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.0.tgz", + "integrity": "sha512-WOhNW9K8bR3kf4zLxbfg6Pxu2ybOUbB2AjMDHSQx86LIF4rH4Ft7vmMwNt0loO0eonglSNy4cpD3MKXXKQu0/A==", "cpu": [ "arm" ], @@ -1083,9 +1083,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.58.0.tgz", - "integrity": "sha512-+s++dbp+/RTte62mQD9wLSbiMTV+xr/PeRJEc/sFZFSBRlHPNPVaf5FXlzAL77Mr8FtSfQqCN+I598M8U41ccQ==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.0.tgz", + "integrity": "sha512-u6JHLll5QKRvjciE78bQXDmqRqNs5M/3GVqZeMwvmjaNODJih/WIrJlFVEihvV0MiYFmd+ZyPr9wxOVbPAG2Iw==", "cpu": [ "arm64" ], @@ -1097,9 +1097,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.58.0.tgz", - "integrity": "sha512-MFWBwTcYs0jZbINQBXHfSrpSQJq3IUOakcKPzfeSznONop14Pxuqa0Kg19GD0rNBMPQI2tFtu3UzapZpH0Uc1Q==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.0.tgz", + "integrity": "sha512-qEF7CsKKzSRc20Ciu2Zw1wRrBz4g56F7r/vRwY430UPp/nt1x21Q/fpJ9N5l47WWvJlkNCPJz3QRVw008fi7yA==", "cpu": [ "arm64" ], @@ -1111,9 +1111,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.58.0.tgz", - "integrity": "sha512-yiKJY7pj9c9JwzuKYLFaDZw5gma3fI9bkPEIyofvVfsPqjCWPglSHdpdwXpKGvDeYDms3Qal8qGMEHZ1M/4Udg==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.0.tgz", + "integrity": "sha512-WADYozJ4QCnXCH4wPB+3FuGmDPoFseVCUrANmA5LWwGmC6FL14BWC7pcq+FstOZv3baGX65tZ378uT6WG8ynTw==", "cpu": [ "x64" ], @@ -1125,9 +1125,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.58.0.tgz", - "integrity": "sha512-x97kCoBh5MOevpn/CNK9W1x8BEzO238541BGWBc315uOlN0AD/ifZ1msg+ZQB05Ux+VF6EcYqpiagfLJ8U3LvQ==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.0.tgz", + "integrity": "sha512-6b8wGHJlDrGeSE3aH5mGNHBjA0TTkxdoNHik5EkvPHCt351XnigA4pS7Wsj/Eo9Y8RBU6f35cjN9SYmCFBtzxw==", "cpu": [ "arm64" ], @@ -1139,9 +1139,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.58.0.tgz", - "integrity": "sha512-Aa8jPoZ6IQAG2eIrcXPpjRcMjROMFxCt1UYPZZtCxRV68WkuSigYtQ/7Zwrcr2IvtNJo7T2JfDXyMLxq5L4Jlg==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.0.tgz", + "integrity": "sha512-h25Ga0t4jaylMB8M/JKAyrvvfxGRjnPQIR8lnCayyzEjEOx2EJIlIiMbhpWxDRKGKF8jbNH01NnN663dH638mA==", "cpu": [ "x64" ], @@ -1153,9 +1153,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.58.0.tgz", - "integrity": "sha512-Ob8YgT5kD/lSIYW2Rcngs5kNB/44Q2RzBSPz9brf2WEtcGR7/f/E9HeHn1wYaAwKBni+bdXEwgHvUd0x12lQSA==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.0.tgz", + "integrity": "sha512-RzeBwv0B3qtVBWtcuABtSuCzToo2IEAIQrcyB/b2zMvBWVbjo8bZDjACUpnaafaxhTw2W+imQbP2BD1usasK4g==", "cpu": [ "arm" ], @@ -1167,9 +1167,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.58.0.tgz", - "integrity": "sha512-K+RI5oP1ceqoadvNt1FecL17Qtw/n9BgRSzxif3rTL2QlIu88ccvY+Y9nnHe/cmT5zbH9+bpiJuG1mGHRVwF4Q==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.0.tgz", + "integrity": "sha512-Sf7zusNI2CIU1HLzuu9Tc5YGAHEZs5Lu7N1ssJG4Tkw6e0MEsN7NdjUDDfGNHy2IU+ENyWT+L2obgWiguWibWQ==", "cpu": [ "arm" ], @@ -1181,9 +1181,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.58.0.tgz", - "integrity": "sha512-T+17JAsCKUjmbopcKepJjHWHXSjeW7O5PL7lEFaeQmiVyw4kkc5/lyYKzrv6ElWRX/MrEWfPiJWqbTvfIvjM1Q==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.0.tgz", + "integrity": "sha512-DX2x7CMcrJzsE91q7/O02IJQ5/aLkVtYFryqCjduJhUfGKG6yJV8hxaw8pZa93lLEpPTP/ohdN4wFz7yp/ry9A==", "cpu": [ "arm64" ], @@ -1195,9 +1195,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.58.0.tgz", - "integrity": "sha512-cCePktb9+6R9itIJdeCFF9txPU7pQeEHB5AbHu/MKsfH/k70ZtOeq1k4YAtBv9Z7mmKI5/wOLYjQ+B9QdxR6LA==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.0.tgz", + "integrity": "sha512-09EL+yFVbJZlhcQfShpswwRZ0Rg+z/CsSELFCnPt3iK+iqwGsI4zht3secj5vLEs957QvFFXnzAT0FFPIxSrkQ==", "cpu": [ "arm64" ], @@ -1209,9 +1209,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.58.0.tgz", - "integrity": "sha512-iekUaLkfliAsDl4/xSdoCJ1gnnIXvoNz85C8U8+ZxknM5pBStfZjeXgB8lXobDQvvPRCN8FPmmuTtH+z95HTmg==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.0.tgz", + "integrity": "sha512-i9IcCMPr3EXm8EQg5jnja0Zyc1iFxJjZWlb4wr7U2Wx/GrddOuEafxRdMPRYVaXjgbhvqalp6np07hN1w9kAKw==", "cpu": [ "loong64" ], @@ -1223,9 +1223,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.58.0.tgz", - "integrity": "sha512-68ofRgJNl/jYJbxFjCKE7IwhbfxOl1muPN4KbIqAIe32lm22KmU7E8OPvyy68HTNkI2iV/c8y2kSPSm2mW/Q9Q==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.0.tgz", + "integrity": "sha512-DGzdJK9kyJ+B78MCkWeGnpXJ91tK/iKA6HwHxF4TAlPIY7GXEvMe8hBFRgdrR9Ly4qebR/7gfUs9y2IoaVEyog==", "cpu": [ "loong64" ], @@ -1237,9 +1237,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.58.0.tgz", - "integrity": "sha512-dpz8vT0i+JqUKuSNPCP5SYyIV2Lh0sNL1+FhM7eLC457d5B9/BC3kDPp5BBftMmTNsBarcPcoz5UGSsnCiw4XQ==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.0.tgz", + "integrity": "sha512-RwpnLsqC8qbS8z1H1AxBA1H6qknR4YpPR9w2XX0vo2Sz10miu57PkNcnHVaZkbqyw/kUWfKMI73jhmfi9BRMUQ==", "cpu": [ "ppc64" ], @@ -1251,9 +1251,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.58.0.tgz", - "integrity": "sha512-4gdkkf9UJ7tafnweBCR/mk4jf3Jfl0cKX9Np80t5i78kjIH0ZdezUv/JDI2VtruE5lunfACqftJ8dIMGN4oHew==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.0.tgz", + "integrity": "sha512-Z8pPf54Ly3aqtdWC3G4rFigZgNvd+qJlOE52fmko3KST9SoGfAdSRCwyoyG05q1HrrAblLbk1/PSIV+80/pxLg==", "cpu": [ "ppc64" ], @@ -1265,9 +1265,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.58.0.tgz", - "integrity": "sha512-YFS4vPnOkDTD/JriUeeZurFYoJhPf9GQQEF/v4lltp3mVcBmnsAdjEWhr2cjUCZzZNzxCG0HZOvJU44UGHSdzw==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.0.tgz", + "integrity": "sha512-3a3qQustp3COCGvnP4SvrMHnPQ9d1vzCakQVRTliaz8cIp/wULGjiGpbcqrkv0WrHTEp8bQD/B3HBjzujVWLOA==", "cpu": [ "riscv64" ], @@ -1279,9 +1279,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.58.0.tgz", - "integrity": "sha512-x2xgZlFne+QVNKV8b4wwaCS8pwq3y14zedZ5DqLzjdRITvreBk//4Knbcvm7+lWmms9V9qFp60MtUd0/t/PXPw==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.0.tgz", + "integrity": "sha512-pjZDsVH/1VsghMJ2/kAaxt6dL0psT6ZexQVrijczOf+PeP2BUqTHYejk3l6TlPRydggINOeNRhvpLa0AYpCWSQ==", "cpu": [ "riscv64" ], @@ -1293,9 +1293,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.58.0.tgz", - "integrity": "sha512-jIhrujyn4UnWF8S+DHSkAkDEO3hLX0cjzxJZPLF80xFyzyUIYgSMRcYQ3+uqEoyDD2beGq7Dj7edi8OnJcS/hg==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.0.tgz", + "integrity": "sha512-3ObQs0BhvPgiUVZrN7gqCSvmFuMWvWvsjG5ayJ3Lraqv+2KhOsp+pUbigqbeWqueGIsnn+09HBw27rJ+gYK4VQ==", "cpu": [ "s390x" ], @@ -1307,9 +1307,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.58.0.tgz", - "integrity": "sha512-+410Srdoh78MKSJxTQ+hZ/Mx+ajd6RjjPwBPNd0R3J9FtL6ZA0GqiiyNjCO9In0IzZkCNrpGymSfn+kgyPQocg==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.0.tgz", + "integrity": "sha512-EtylprDtQPdS5rXvAayrNDYoJhIz1/vzN2fEubo3yLE7tfAw+948dO0g4M0vkTVFhKojnF+n6C8bDNe+gDRdTg==", "cpu": [ "x64" ], @@ -1321,9 +1321,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.58.0.tgz", - "integrity": "sha512-ZjMyby5SICi227y1MTR3VYBpFTdZs823Rs/hpakufleBoufoOIB6jtm9FEoxn/cgO7l6PM2rCEl5Kre5vX0QrQ==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.0.tgz", + "integrity": "sha512-k09oiRCi/bHU9UVFqD17r3eJR9bn03TyKraCrlz5ULFJGdJGi7VOmm9jl44vOJvRJ6P7WuBi/s2A97LxxHGIdw==", "cpu": [ "x64" ], @@ -1335,9 +1335,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.58.0.tgz", - "integrity": "sha512-ds4iwfYkSQ0k1nb8LTcyXw//ToHOnNTJtceySpL3fa7tc/AsE+UpUFphW126A6fKBGJD5dhRvg8zw1rvoGFxmw==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.0.tgz", + "integrity": "sha512-1o/0/pIhozoSaDJoDcec+IVLbnRtQmHwPV730+AOD29lHEEo4F5BEUB24H0OBdhbBBDwIOSuf7vgg0Ywxdfiiw==", "cpu": [ "x64" ], @@ -1349,9 +1349,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.58.0.tgz", - "integrity": "sha512-fd/zpJniln4ICdPkjWFhZYeY/bpnaN9pGa6ko+5WD38I0tTqk9lXMgXZg09MNdhpARngmxiCg0B0XUamNw/5BQ==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.0.tgz", + "integrity": "sha512-pESDkos/PDzYwtyzB5p/UoNU/8fJo68vcXM9ZW2V0kjYayj1KaaUfi1NmTUTUpMn4UhU4gTuK8gIaFO4UGuMbA==", "cpu": [ "arm64" ], @@ -1363,9 +1363,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.58.0.tgz", - "integrity": "sha512-YpG8dUOip7DCz3nr/JUfPbIUo+2d/dy++5bFzgi4ugOGBIox+qMbbqt/JoORwvI/C9Kn2tz6+Bieoqd5+B1CjA==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.0.tgz", + "integrity": "sha512-hj1wFStD7B1YBeYmvY+lWXZ7ey73YGPcViMShYikqKT1GtstIKQAtfUI6yrzPjAy/O7pO0VLXGmUVWXQMaYgTQ==", "cpu": [ "arm64" ], @@ -1377,9 +1377,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.58.0.tgz", - "integrity": "sha512-b9DI8jpFQVh4hIXFr0/+N/TzLdpBIoPzjt0Rt4xJbW3mzguV3mduR9cNgiuFcuL/TeORejJhCWiAXe3E/6PxWA==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.0.tgz", + "integrity": "sha512-SyaIPFoxmUPlNDq5EHkTbiKzmSEmq/gOYFI/3HHJ8iS/v1mbugVa7dXUzcJGQfoytp9DJFLhHH4U3/eTy2Bq4w==", "cpu": [ "ia32" ], @@ -1391,9 +1391,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.58.0.tgz", - "integrity": "sha512-CSrVpmoRJFN06LL9xhkitkwUcTZtIotYAF5p6XOR2zW0Zz5mzb3IPpcoPhB02frzMHFNo1reQ9xSF5fFm3hUsQ==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.0.tgz", + "integrity": "sha512-RdcryEfzZr+lAr5kRm2ucN9aVlCCa2QNq4hXelZxb8GG0NJSazq44Z3PCCc8wISRuCVnGs0lQJVX5Vp6fKA+IA==", "cpu": [ "x64" ], @@ -1405,9 +1405,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.58.0.tgz", - "integrity": "sha512-QFsBgQNTnh5K0t/sBsjJLq24YVqEIVkGpfN2VHsnN90soZyhaiA9UUHufcctVNL4ypJY0wrwad0wslx2KJQ1/w==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.0.tgz", + "integrity": "sha512-PrsWNQ8BuE00O3Xsx3ALh2Df8fAj9+cvvX9AIA6o4KpATR98c9mud4XtDWVvsEuyia5U4tVSTKygawyJkjm60w==", "cpu": [ "x64" ], @@ -1430,23 +1430,10 @@ "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" } }, - "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", - "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@tanstack/query-core": { - "version": "5.91.2", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.91.2.tgz", - "integrity": "sha512-Uz2pTgPC1mhqrrSGg18RKCWT/pkduAYtxbcyIyKBhw7dTWjXZIzqmpzO2lBkyWr4hlImQgpu1m1pei3UnkFRWw==", + "version": "5.95.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.95.2.tgz", + "integrity": "sha512-o4T8vZHZET4Bib3jZ/tCW9/7080urD4c+0/AUaYVpIqOsr7y0reBc1oX3ttNaSW5mYyvZHctiQ/UOP2PfdmFEQ==", "license": "MIT", "funding": { "type": "github", @@ -1454,12 +1441,12 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.91.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.91.2.tgz", - "integrity": "sha512-GClLPzbM57iFXv+FlvOUL56XVe00PxuTaVEyj1zAObhRiKF008J5vedmaq7O6ehs+VmPHe8+PUQhMuEyv8d9wQ==", + "version": "5.95.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.95.2.tgz", + "integrity": "sha512-/wGkvLj/st5Ud1Q76KF1uFxScV7WeqN1slQx5280ycwAyYkIPGaRZAEgHxe3bjirSd5Zpwkj6zNcR4cqYni/ZA==", "license": "MIT", "dependencies": { - "@tanstack/query-core": "5.91.2" + "@tanstack/query-core": "5.95.2" }, "funding": { "type": "github", @@ -1515,9 +1502,9 @@ } }, "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", "license": "MIT", "dependencies": { "@types/ms": "*" @@ -1570,9 +1557,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "24.10.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.13.tgz", - "integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==", + "version": "24.12.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz", + "integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1605,17 +1592,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.0.tgz", - "integrity": "sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.2.tgz", + "integrity": "sha512-NZZgp0Fm2IkD+La5PR81sd+g+8oS6JwJje+aRWsDocxHkjyRw0J5L5ZTlN3LI1LlOcGL7ph3eaIUmTXMIjLk0w==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.56.0", - "@typescript-eslint/type-utils": "8.56.0", - "@typescript-eslint/utils": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0", + "@typescript-eslint/scope-manager": "8.57.2", + "@typescript-eslint/type-utils": "8.57.2", + "@typescript-eslint/utils": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" @@ -1628,7 +1615,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.56.0", + "@typescript-eslint/parser": "^8.57.2", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } @@ -1644,16 +1631,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.0.tgz", - "integrity": "sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.57.2.tgz", + "integrity": "sha512-30ScMRHIAD33JJQkgfGW1t8CURZtjc2JpTrq5n2HFhOefbAhb7ucc7xJwdWcrEtqUIYJ73Nybpsggii6GtAHjA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.56.0", - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0", + "@typescript-eslint/scope-manager": "8.57.2", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2", "debug": "^4.4.3" }, "engines": { @@ -1669,14 +1656,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.0.tgz", - "integrity": "sha512-M3rnyL1vIQOMeWxTWIW096/TtVP+8W3p/XnaFflhmcFp+U4zlxUxWj4XwNs6HbDeTtN4yun0GNTTDBw/SvufKg==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.57.2.tgz", + "integrity": "sha512-FuH0wipFywXRTHf+bTTjNyuNQQsQC3qh/dYzaM4I4W0jrCqjCVuUh99+xd9KamUfmCGPvbO8NDngo/vsnNVqgw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.56.0", - "@typescript-eslint/types": "^8.56.0", + "@typescript-eslint/tsconfig-utils": "^8.57.2", + "@typescript-eslint/types": "^8.57.2", "debug": "^4.4.3" }, "engines": { @@ -1691,14 +1678,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.0.tgz", - "integrity": "sha512-7UiO/XwMHquH+ZzfVCfUNkIXlp/yQjjnlYUyYz7pfvlK3/EyyN6BK+emDmGNyQLBtLGaYrTAI6KOw8tFucWL2w==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.57.2.tgz", + "integrity": "sha512-snZKH+W4WbWkrBqj4gUNRIGb/jipDW3qMqVJ4C9rzdFc+wLwruxk+2a5D+uoFcKPAqyqEnSb4l2ULuZf95eSkw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0" + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1709,9 +1696,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.0.tgz", - "integrity": "sha512-bSJoIIt4o3lKXD3xmDh9chZcjCz5Lk8xS7Rxn+6l5/pKrDpkCwtQNQQwZ2qRPk7TkUYhrq3WPIHXOXlbXP0itg==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.57.2.tgz", + "integrity": "sha512-3Lm5DSM+DCowsUOJC+YqHHnKEfFh5CoGkj5Z31NQSNF4l5wdOwqGn99wmwN/LImhfY3KJnmordBq/4+VDe2eKw==", "dev": true, "license": "MIT", "engines": { @@ -1726,15 +1713,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.0.tgz", - "integrity": "sha512-qX2L3HWOU2nuDs6GzglBeuFXviDODreS58tLY/BALPC7iu3Fa+J7EOTwnX9PdNBxUI7Uh0ntP0YWGnxCkXzmfA==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.57.2.tgz", + "integrity": "sha512-Co6ZCShm6kIbAM/s+oYVpKFfW7LBc6FXoPXjTRQ449PPNBY8U0KZXuevz5IFuuUj2H9ss40atTaf9dlGLzbWZg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0", - "@typescript-eslint/utils": "8.56.0", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2", + "@typescript-eslint/utils": "8.57.2", "debug": "^4.4.3", "ts-api-utils": "^2.4.0" }, @@ -1751,9 +1738,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.0.tgz", - "integrity": "sha512-DBsLPs3GsWhX5HylbP9HNG15U0bnwut55Lx12bHB9MpXxQ+R5GC8MwQe+N1UFXxAeQDvEsEDY6ZYwX03K7Z6HQ==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.57.2.tgz", + "integrity": "sha512-/iZM6FnM4tnx9csuTxspMW4BOSegshwX5oBDznJ7S4WggL7Vczz5d2W11ecc4vRrQMQHXRSxzrCsyG5EsPPTbA==", "dev": true, "license": "MIT", "engines": { @@ -1765,18 +1752,18 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.0.tgz", - "integrity": "sha512-ex1nTUMWrseMltXUHmR2GAQ4d+WjkZCT4f+4bVsps8QEdh0vlBsaCokKTPlnqBFqqGaxilDNJG7b8dolW2m43Q==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.57.2.tgz", + "integrity": "sha512-2MKM+I6g8tJxfSmFKOnHv2t8Sk3T6rF20A1Puk0svLK+uVapDZB/4pfAeB7nE83uAZrU6OxW+HmOd5wHVdXwXA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.56.0", - "@typescript-eslint/tsconfig-utils": "8.56.0", - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/visitor-keys": "8.56.0", + "@typescript-eslint/project-service": "8.57.2", + "@typescript-eslint/tsconfig-utils": "8.57.2", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/visitor-keys": "8.57.2", "debug": "^4.4.3", - "minimatch": "^9.0.5", + "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.4.0" @@ -1792,27 +1779,40 @@ "typescript": ">=4.8.4 <6.0.0" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^5.0.2" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1832,16 +1832,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.0.tgz", - "integrity": "sha512-RZ3Qsmi2nFGsS+n+kjLAYDPVlrzf7UhTffrDIKr+h2yzAlYP/y5ZulU0yeDEPItos2Ph46JAL5P/On3pe7kDIQ==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.57.2.tgz", + "integrity": "sha512-krRIbvPK1ju1WBKIefiX+bngPs+odIQUtR7kymzPfo1POVw3jlF+nLkmexdSSd4UCbDcQn+wMBATOOmpBbqgKg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.56.0", - "@typescript-eslint/types": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0" + "@typescript-eslint/scope-manager": "8.57.2", + "@typescript-eslint/types": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1856,13 +1856,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.0.tgz", - "integrity": "sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.57.2.tgz", + "integrity": "sha512-zhahknjobV2FiD6Ee9iLbS7OV9zi10rG26odsQdfBO/hjSzUQbkIYgda+iNKK1zNiW2ey+Lf8MU5btN17V3dUw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.56.0", + "@typescript-eslint/types": "8.57.2", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -1893,9 +1893,9 @@ "license": "ISC" }, "node_modules/@vitejs/plugin-react": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz", - "integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", + "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", "dev": true, "license": "MIT", "dependencies": { @@ -1910,7 +1910,7 @@ "node": "^20.19.0 || >=22.12.0" }, "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn": { @@ -1988,18 +1988,6 @@ "node": ">= 8" } }, - "node_modules/anymatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -2014,9 +2002,9 @@ "license": "Python-2.0" }, "node_modules/autoprefixer": { - "version": "10.4.24", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.24.tgz", - "integrity": "sha512-uHZg7N9ULTVbutaIsDRoUkoS8/h3bdsmVJYZ5l3wv8Cp/6UIIoRDm90hZ+BwxUj/hGBEzLxdHNSKuFpn8WOyZw==", + "version": "10.4.27", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.27.tgz", + "integrity": "sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA==", "dev": true, "funding": [ { @@ -2035,7 +2023,7 @@ "license": "MIT", "dependencies": { "browserslist": "^4.28.1", - "caniuse-lite": "^1.0.30001766", + "caniuse-lite": "^1.0.30001774", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" @@ -2068,9 +2056,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", - "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==", + "version": "2.10.10", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.10.tgz", + "integrity": "sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2169,9 +2157,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001770", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001770.tgz", - "integrity": "sha512-x/2CLQ1jHENRbHg5PSId2sXq1CIO1CISvwWAj027ltMVG2UNgW+w9oH2+HzgEIRFembL8bUlXtfbBHR1fCg2xw==", + "version": "1.0.30001781", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001781.tgz", + "integrity": "sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==", "dev": true, "funding": [ { @@ -2463,16 +2451,16 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.302", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz", - "integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==", + "version": "1.5.321", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.321.tgz", + "integrity": "sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==", "dev": true, "license": "ISC" }, "node_modules/esbuild": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", - "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.4.tgz", + "integrity": "sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2483,32 +2471,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.3", - "@esbuild/android-arm": "0.27.3", - "@esbuild/android-arm64": "0.27.3", - "@esbuild/android-x64": "0.27.3", - "@esbuild/darwin-arm64": "0.27.3", - "@esbuild/darwin-x64": "0.27.3", - "@esbuild/freebsd-arm64": "0.27.3", - "@esbuild/freebsd-x64": "0.27.3", - "@esbuild/linux-arm": "0.27.3", - "@esbuild/linux-arm64": "0.27.3", - "@esbuild/linux-ia32": "0.27.3", - "@esbuild/linux-loong64": "0.27.3", - "@esbuild/linux-mips64el": "0.27.3", - "@esbuild/linux-ppc64": "0.27.3", - "@esbuild/linux-riscv64": "0.27.3", - "@esbuild/linux-s390x": "0.27.3", - "@esbuild/linux-x64": "0.27.3", - "@esbuild/netbsd-arm64": "0.27.3", - "@esbuild/netbsd-x64": "0.27.3", - "@esbuild/openbsd-arm64": "0.27.3", - "@esbuild/openbsd-x64": "0.27.3", - "@esbuild/openharmony-arm64": "0.27.3", - "@esbuild/sunos-x64": "0.27.3", - "@esbuild/win32-arm64": "0.27.3", - "@esbuild/win32-ia32": "0.27.3", - "@esbuild/win32-x64": "0.27.3" + "@esbuild/aix-ppc64": "0.27.4", + "@esbuild/android-arm": "0.27.4", + "@esbuild/android-arm64": "0.27.4", + "@esbuild/android-x64": "0.27.4", + "@esbuild/darwin-arm64": "0.27.4", + "@esbuild/darwin-x64": "0.27.4", + "@esbuild/freebsd-arm64": "0.27.4", + "@esbuild/freebsd-x64": "0.27.4", + "@esbuild/linux-arm": "0.27.4", + "@esbuild/linux-arm64": "0.27.4", + "@esbuild/linux-ia32": "0.27.4", + "@esbuild/linux-loong64": "0.27.4", + "@esbuild/linux-mips64el": "0.27.4", + "@esbuild/linux-ppc64": "0.27.4", + "@esbuild/linux-riscv64": "0.27.4", + "@esbuild/linux-s390x": "0.27.4", + "@esbuild/linux-x64": "0.27.4", + "@esbuild/netbsd-arm64": "0.27.4", + "@esbuild/netbsd-x64": "0.27.4", + "@esbuild/openbsd-arm64": "0.27.4", + "@esbuild/openbsd-x64": "0.27.4", + "@esbuild/openharmony-arm64": "0.27.4", + "@esbuild/sunos-x64": "0.27.4", + "@esbuild/win32-arm64": "0.27.4", + "@esbuild/win32-ia32": "0.27.4", + "@esbuild/win32-x64": "0.27.4" } }, "node_modules/escalade": { @@ -2535,25 +2523,25 @@ } }, "node_modules/eslint": { - "version": "9.39.3", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.3.tgz", - "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==", + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.1", + "@eslint/config-array": "^0.21.2", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.39.3", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", - "ajv": "^6.12.4", + "ajv": "^6.14.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", @@ -2572,7 +2560,7 @@ "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", + "minimatch": "^3.1.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, @@ -2792,23 +2780,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -2866,9 +2837,9 @@ } }, "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, "license": "ISC" }, @@ -4243,22 +4214,10 @@ "node": ">=8.6" } }, - "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -4311,9 +4270,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.27", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", - "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", + "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", "dev": true, "license": "MIT" }, @@ -4465,12 +4424,12 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", "engines": { - "node": ">=12" + "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -4495,9 +4454,9 @@ } }, "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", "funding": [ { "type": "opencollective", @@ -4631,7 +4590,7 @@ "postcss": "^8.2.14" } }, - "node_modules/postcss-selector-parser": { + "node_modules/postcss-nested/node_modules/postcss-selector-parser": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", @@ -4644,6 +4603,19 @@ "node": ">=4" } }, + "node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", @@ -4759,9 +4731,9 @@ } }, "node_modules/react-router": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.0.tgz", - "integrity": "sha512-PZgus8ETambRT17BUm/LL8lX3Of+oiLaPuVTRH3l1eLvSPpKO3AvhAEb5N7ihAFZQrYDqkvvWfFh9p0z9VsjLw==", + "version": "7.13.2", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.2.tgz", + "integrity": "sha512-tX1Aee+ArlKQP+NIUd7SE6Li+CiGKwQtbS+FfRxPX6Pe4vHOo6nr9d++u5cwg+Z8K/x8tP+7qLmujDtfrAoUJA==", "license": "MIT", "dependencies": { "cookie": "^1.0.1", @@ -4781,12 +4753,12 @@ } }, "node_modules/react-router-dom": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.0.tgz", - "integrity": "sha512-5CO/l5Yahi2SKC6rGZ+HDEjpjkGaG/ncEP7eWFTvFxbHP8yeeI0PxTDjimtpXYlR3b3i9/WIL4VJttPrESIf2g==", + "version": "7.13.2", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.2.tgz", + "integrity": "sha512-aR7SUORwTqAW0JDeiWF07e9SBE9qGpByR9I8kJT5h/FrBKxPMS6TiC7rmVO+gC0q52Bx7JnjWe8Z1sR9faN4YA==", "license": "MIT", "dependencies": { - "react-router": "7.13.0" + "react-router": "7.13.2" }, "engines": { "node": ">=20.0.0" @@ -4817,18 +4789,6 @@ "node": ">=8.10.0" } }, - "node_modules/readdirp/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/remark-gfm": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", @@ -4936,9 +4896,9 @@ } }, "node_modules/rollup": { - "version": "4.58.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.58.0.tgz", - "integrity": "sha512-wbT0mBmWbIvvq8NeEYWWvevvxnOyhKChir47S66WCxw1SXqhw7ssIYejnQEVt7XYQpsj2y8F9PM+Cr3SNEa0gw==", + "version": "4.60.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.0.tgz", + "integrity": "sha512-yqjxruMGBQJ2gG4HtjZtAfXArHomazDHoFwFFmZZl0r7Pdo7qCIXKqKHZc8yeoMgzJJ+pO6pEEHa+V7uzWlrAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4952,31 +4912,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.58.0", - "@rollup/rollup-android-arm64": "4.58.0", - "@rollup/rollup-darwin-arm64": "4.58.0", - "@rollup/rollup-darwin-x64": "4.58.0", - "@rollup/rollup-freebsd-arm64": "4.58.0", - "@rollup/rollup-freebsd-x64": "4.58.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.58.0", - "@rollup/rollup-linux-arm-musleabihf": "4.58.0", - "@rollup/rollup-linux-arm64-gnu": "4.58.0", - "@rollup/rollup-linux-arm64-musl": "4.58.0", - "@rollup/rollup-linux-loong64-gnu": "4.58.0", - "@rollup/rollup-linux-loong64-musl": "4.58.0", - "@rollup/rollup-linux-ppc64-gnu": "4.58.0", - "@rollup/rollup-linux-ppc64-musl": "4.58.0", - "@rollup/rollup-linux-riscv64-gnu": "4.58.0", - "@rollup/rollup-linux-riscv64-musl": "4.58.0", - "@rollup/rollup-linux-s390x-gnu": "4.58.0", - "@rollup/rollup-linux-x64-gnu": "4.58.0", - "@rollup/rollup-linux-x64-musl": "4.58.0", - "@rollup/rollup-openbsd-x64": "4.58.0", - "@rollup/rollup-openharmony-arm64": "4.58.0", - "@rollup/rollup-win32-arm64-msvc": "4.58.0", - "@rollup/rollup-win32-ia32-msvc": "4.58.0", - "@rollup/rollup-win32-x64-gnu": "4.58.0", - "@rollup/rollup-win32-x64-msvc": "4.58.0", + "@rollup/rollup-android-arm-eabi": "4.60.0", + "@rollup/rollup-android-arm64": "4.60.0", + "@rollup/rollup-darwin-arm64": "4.60.0", + "@rollup/rollup-darwin-x64": "4.60.0", + "@rollup/rollup-freebsd-arm64": "4.60.0", + "@rollup/rollup-freebsd-x64": "4.60.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.0", + "@rollup/rollup-linux-arm-musleabihf": "4.60.0", + "@rollup/rollup-linux-arm64-gnu": "4.60.0", + "@rollup/rollup-linux-arm64-musl": "4.60.0", + "@rollup/rollup-linux-loong64-gnu": "4.60.0", + "@rollup/rollup-linux-loong64-musl": "4.60.0", + "@rollup/rollup-linux-ppc64-gnu": "4.60.0", + "@rollup/rollup-linux-ppc64-musl": "4.60.0", + "@rollup/rollup-linux-riscv64-gnu": "4.60.0", + "@rollup/rollup-linux-riscv64-musl": "4.60.0", + "@rollup/rollup-linux-s390x-gnu": "4.60.0", + "@rollup/rollup-linux-x64-gnu": "4.60.0", + "@rollup/rollup-linux-x64-musl": "4.60.0", + "@rollup/rollup-openbsd-x64": "4.60.0", + "@rollup/rollup-openharmony-arm64": "4.60.0", + "@rollup/rollup-win32-arm64-msvc": "4.60.0", + "@rollup/rollup-win32-ia32-msvc": "4.60.0", + "@rollup/rollup-win32-x64-gnu": "4.60.0", + "@rollup/rollup-win32-x64-msvc": "4.60.0", "fsevents": "~2.3.2" } }, @@ -5196,6 +5156,19 @@ "node": ">=14.0.0" } }, + "node_modules/tailwindcss/node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -5233,6 +5206,35 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5266,9 +5268,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", - "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "dev": true, "license": "MIT", "engines": { @@ -5312,16 +5314,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.56.0.tgz", - "integrity": "sha512-c7toRLrotJ9oixgdW7liukZpsnq5CZ7PuKztubGYlNppuTqhIoWfhgHo/7EU0v06gS2l/x0i2NEFK1qMIf0rIg==", + "version": "8.57.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.57.2.tgz", + "integrity": "sha512-VEPQ0iPgWO/sBaZOU1xo4nuNdODVOajPnTIbog2GKYr31nIlZ0fWPoCQgGfF3ETyBl1vn63F/p50Um9Z4J8O8A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.56.0", - "@typescript-eslint/parser": "8.56.0", - "@typescript-eslint/typescript-estree": "8.56.0", - "@typescript-eslint/utils": "8.56.0" + "@typescript-eslint/eslint-plugin": "8.57.2", + "@typescript-eslint/parser": "8.57.2", + "@typescript-eslint/typescript-estree": "8.57.2", + "@typescript-eslint/utils": "8.57.2" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5579,6 +5581,37 @@ } } }, + "node_modules/vite/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/frontend/package.json b/apps/website/package.json similarity index 97% rename from frontend/package.json rename to apps/website/package.json index d2db3a1..84b9699 100644 --- a/frontend/package.json +++ b/apps/website/package.json @@ -1,5 +1,5 @@ { - "name": "frontend", + "name": "website", "private": true, "version": "0.0.0", "type": "module", diff --git a/frontend/postcss.config.js b/apps/website/postcss.config.js similarity index 100% rename from frontend/postcss.config.js rename to apps/website/postcss.config.js diff --git a/frontend/public/vite.svg b/apps/website/public/vite.svg similarity index 100% rename from frontend/public/vite.svg rename to apps/website/public/vite.svg diff --git a/frontend/src/App.tsx b/apps/website/src/App.tsx similarity index 100% rename from frontend/src/App.tsx rename to apps/website/src/App.tsx diff --git a/frontend/src/components/Layout.tsx b/apps/website/src/components/Layout.tsx similarity index 88% rename from frontend/src/components/Layout.tsx rename to apps/website/src/components/Layout.tsx index d8b9ec6..4ace288 100644 --- a/frontend/src/components/Layout.tsx +++ b/apps/website/src/components/Layout.tsx @@ -4,7 +4,7 @@ import { ToastContainer } from '../hooks/useToast'; import { Settings, LogOut } from 'lucide-react'; export default function Layout() { - const { user, supabaseConfigured } = useAuth(); + const { user, supabaseConfigured, loading } = useAuth(); const location = useLocation(); const isActive = (path: string) => { @@ -42,7 +42,12 @@ export default function Layout() { )} - {supabaseConfigured && ( + {loading ? ( + // Loading indicator while auth is being verified +
+ +
+ ) : supabaseConfigured ? ( <> {user ? ( <> @@ -59,7 +64,7 @@ export default function Layout() { )} - )} + ) : null} diff --git a/frontend/src/components/PromptTextarea.tsx b/apps/website/src/components/PromptTextarea.tsx similarity index 100% rename from frontend/src/components/PromptTextarea.tsx rename to apps/website/src/components/PromptTextarea.tsx diff --git a/frontend/src/hooks/useAuth.tsx b/apps/website/src/hooks/useAuth.tsx similarity index 87% rename from frontend/src/hooks/useAuth.tsx rename to apps/website/src/hooks/useAuth.tsx index 2efd947..5518be9 100644 --- a/frontend/src/hooks/useAuth.tsx +++ b/apps/website/src/hooks/useAuth.tsx @@ -18,7 +18,7 @@ const AuthContext = createContext({ export function AuthProvider({ children }: { children: ReactNode }) { const [user, setUser] = useState(null); const [supabaseConfigured, setSupabaseConfigured] = useState(false); - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(true); const refresh = async () => { setLoading(true); @@ -34,7 +34,7 @@ export function AuthProvider({ children }: { children: ReactNode }) { }; useEffect(() => { - // Non-blocking auth check - start with null user, verify in background + // Initial auth check - wait for result before rendering auth-dependent UI getMe() .then((data) => { setUser(data.user); @@ -42,6 +42,9 @@ export function AuthProvider({ children }: { children: ReactNode }) { }) .catch(() => { setUser(null); + }) + .finally(() => { + setLoading(false); }); }, []); diff --git a/frontend/src/hooks/useKits.ts b/apps/website/src/hooks/useKits.ts similarity index 100% rename from frontend/src/hooks/useKits.ts rename to apps/website/src/hooks/useKits.ts diff --git a/frontend/src/hooks/useToast.tsx b/apps/website/src/hooks/useToast.tsx similarity index 100% rename from frontend/src/hooks/useToast.tsx rename to apps/website/src/hooks/useToast.tsx diff --git a/frontend/src/index.css b/apps/website/src/index.css similarity index 100% rename from frontend/src/index.css rename to apps/website/src/index.css diff --git a/frontend/src/lib/api.ts b/apps/website/src/lib/api.ts similarity index 82% rename from frontend/src/lib/api.ts rename to apps/website/src/lib/api.ts index b79f576..b81adf7 100644 --- a/frontend/src/lib/api.ts +++ b/apps/website/src/lib/api.ts @@ -28,6 +28,14 @@ async function handleResponse(response: Response): Promise { return response.json(); } +// Wrapper for fetch that always includes credentials (cookies) +async function apiFetch(url: string, options: RequestInit = {}): Promise { + return fetch(url, { + ...options, + credentials: 'include', // Required for session cookies + }); +} + // ─── Auth ──────────────────────────────────────────────────────────────────── export interface User { @@ -44,7 +52,7 @@ export interface AuthResponse { } export async function login(email: string, password: string): Promise { - const res = await fetch(`${API_BASE}/auth/login`, { + const res = await apiFetch(`${API_BASE}/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }), @@ -53,7 +61,7 @@ export async function login(email: string, password: string): Promise { - const res = await fetch(`${API_BASE}/auth/signup`, { + const res = await apiFetch(`${API_BASE}/auth/signup`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }), @@ -62,12 +70,12 @@ export async function signup(email: string, password: string): Promise { - const res = await fetch(`${API_BASE}/auth/logout`, { method: 'POST' }); + const res = await apiFetch(`${API_BASE}/auth/logout`, { method: 'POST' }); return handleResponse(res); } export async function resetPassword(email: string): Promise { - const res = await fetch(`${API_BASE}/auth/reset-password`, { + const res = await apiFetch(`${API_BASE}/auth/reset-password`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email }), @@ -76,7 +84,7 @@ export async function resetPassword(email: string): Promise { } export async function getMe(): Promise<{ user: User | null; supabase_configured: boolean }> { - const res = await fetch(`${API_BASE}/auth/me`); + const res = await apiFetch(`${API_BASE}/auth/me`); return handleResponse(res); } @@ -145,28 +153,28 @@ export interface KitDetail { } export async function listKits(): Promise<{ kits: Kit[] }> { - const res = await fetch(`${API_BASE}/kits`); + const res = await apiFetch(`${API_BASE}/kits`); return handleResponse(res); } export async function searchKits(query: string, filter: string = 'all'): Promise<{ kits: Kit[] }> { const params = new URLSearchParams({ q: query, filter }); - const res = await fetch(`${API_BASE}/kits/search?${params.toString()}`); + const res = await apiFetch(`${API_BASE}/kits/search?${params.toString()}`); return handleResponse(res); } export async function getKit(slug: string): Promise { - const res = await fetch(`${API_BASE}/kits/${slug}/detail`); + const res = await apiFetch(`${API_BASE}/kits/${slug}/detail`); return handleResponse(res); } export async function toggleBookmark(slug: string): Promise<{ ok: boolean; is_bookmarked: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/bookmark`, { method: 'POST' }); + const res = await apiFetch(`${API_BASE}/kits/${slug}/bookmark`, { method: 'POST' }); return handleResponse(res); } export async function createKit(name: string, description: string): Promise<{ ok: boolean; slug: string }> { - const res = await fetch(`${API_BASE}/kits`, { + const res = await apiFetch(`${API_BASE}/kits`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name, description }), @@ -175,7 +183,7 @@ export async function createKit(name: string, description: string): Promise<{ ok } export async function updateKit(slug: string, name: string, description: string): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name, description }), @@ -184,7 +192,7 @@ export async function updateKit(slug: string, name: string, description: string) } export async function deleteKit(slug: string): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}`, { method: 'DELETE' }); + const res = await apiFetch(`${API_BASE}/kits/${slug}`, { method: 'DELETE' }); return handleResponse(res); } @@ -194,7 +202,7 @@ export async function addResource( slug: string, data: FormData ): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/resources`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/resources`, { method: 'POST', body: data, }); @@ -206,7 +214,7 @@ export async function updateResource( number: number, data: FormData ): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/resources/${number}/update`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/resources/${number}/update`, { method: 'POST', body: data, }); @@ -214,14 +222,14 @@ export async function updateResource( } export async function deleteResource(slug: string, number: number): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/resources/${number}`, { method: 'DELETE' }); + const res = await apiFetch(`${API_BASE}/kits/${slug}/resources/${number}`, { method: 'DELETE' }); return handleResponse(res); } // ─── Tools ─────────────────────────────────────────────────────────────────── export async function getAvailableTools(): Promise<{ tools: AvailableTool[] }> { - const res = await fetch(`${API_BASE}/tools/available`); + const res = await apiFetch(`${API_BASE}/tools/available`); return handleResponse(res); } @@ -235,7 +243,7 @@ export async function addTool( if (displayName) payload.display_name = displayName; if (configuration) payload.configuration = configuration; - const res = await fetch(`${API_BASE}/kits/${slug}/tools`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/tools`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -255,7 +263,7 @@ export async function updateTool( if (displayName) payload.display_name = displayName; if (configuration) payload.configuration = configuration; - const res = await fetch(`${API_BASE}/kits/${slug}/tools/${number}/update`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/tools/${number}/update`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -266,7 +274,7 @@ export async function updateTool( } export async function deleteTool(slug: string, number: number): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/tools/${number}`, { method: 'DELETE' }); + const res = await apiFetch(`${API_BASE}/kits/${slug}/tools/${number}`, { method: 'DELETE' }); return handleResponse(res); } @@ -277,7 +285,7 @@ export async function addStep( prompt: string, displayName: string ): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/steps`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/steps`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt, display_name: displayName }), @@ -294,7 +302,7 @@ export async function updateStep( const fd = new FormData(); fd.append('prompt', prompt); fd.append('display_name', displayName); - const res = await fetch(`${API_BASE}/kits/${slug}/steps/${number}/update`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/steps/${number}/update`, { method: 'POST', body: fd, }); @@ -302,7 +310,7 @@ export async function updateStep( } export async function deleteStep(slug: string, number: number): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/steps/${number}`, { method: 'DELETE' }); + const res = await apiFetch(`${API_BASE}/kits/${slug}/steps/${number}`, { method: 'DELETE' }); return handleResponse(res); } @@ -333,14 +341,14 @@ export async function startExecution( } } } - const res = await fetch(`${API_BASE}/kits/${slug}/execute`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/execute`, { method: 'POST', body: fd, }); return handleResponse(res); } - const res = await fetch(`${API_BASE}/kits/${slug}/execute`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/execute`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(config), @@ -354,7 +362,7 @@ export async function submitEvaluation( step: number, score: number ): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/evaluate-step`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/evaluate-step`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ execution_id: executionId, step, score }), @@ -367,14 +375,14 @@ export function getSSEUrl(slug: string, executionId: string): string { } export async function pauseExecution(slug: string, executionId: string): Promise<{ ok: boolean; error?: string }> { - const res = await fetch(`${API_BASE}/kits/${slug}/executions/${executionId}/pause`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/executions/${executionId}/pause`, { method: 'POST', }); return handleResponse(res); } export async function resumeExecution(slug: string, runId: string): Promise<{ execution_id: string; error?: string }> { - const res = await fetch(`${API_BASE}/kits/${slug}/execute/resume`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/execute/resume`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ run_id: runId }), @@ -383,7 +391,7 @@ export async function resumeExecution(slug: string, runId: string): Promise<{ ex } export async function deleteExecution(slug: string, runId: string): Promise<{ ok: boolean; error?: string }> { - const res = await fetch(`${API_BASE}/kits/${slug}/executions/${runId}`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/executions/${runId}`, { method: 'DELETE', }); return handleResponse(res); @@ -402,12 +410,12 @@ export interface ExecutionRun { } export async function listExecutions(slug: string): Promise<{ runs: ExecutionRun[] }> { - const res = await fetch(`${API_BASE}/kits/${slug}/executions`); + const res = await apiFetch(`${API_BASE}/kits/${slug}/executions`); return handleResponse(res); } export async function getExecution(slug: string, runId: string): Promise> { - const res = await fetch(`${API_BASE}/kits/${slug}/executions/${runId}`); + const res = await apiFetch(`${API_BASE}/kits/${slug}/executions/${runId}`); return handleResponse(res); } @@ -416,7 +424,7 @@ export async function updateExecutionLabel( runId: string, label: string ): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/kits/${slug}/executions/${runId}/label`, { + const res = await apiFetch(`${API_BASE}/kits/${slug}/executions/${runId}/label`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ label }), @@ -438,12 +446,12 @@ export interface McpConfig { } export async function getMcpConfigs(): Promise<{ configs: McpConfig[] }> { - const res = await fetch(`${API_BASE}/mcp/config`); + const res = await apiFetch(`${API_BASE}/mcp/config`); return handleResponse(res); } export async function updateMcpConfig(server_name: string, env_vars: Record, is_active: boolean = false): Promise<{ ok: boolean }> { - const res = await fetch(`${API_BASE}/mcp/config/${server_name}`, { + const res = await apiFetch(`${API_BASE}/mcp/config/${server_name}`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ env_vars, is_active }), @@ -462,12 +470,12 @@ export interface DocItem { } export async function getDocsList(): Promise<{ docs: DocItem[] }> { - const res = await fetch(`${API_BASE}/docs`); + const res = await apiFetch(`${API_BASE}/docs`); return handleResponse(res); } export async function getDocContent(slug: string): Promise<{ content: string }> { - const res = await fetch(`${API_BASE}/docs/${slug}`); + const res = await apiFetch(`${API_BASE}/docs/${slug}`); return handleResponse(res); } @@ -484,7 +492,7 @@ export interface LlmConfig { } export async function getLlmConfigs(): Promise<{ configs: LlmConfig[] }> { - const res = await fetch(`${API_BASE}/llm/config`); + const res = await apiFetch(`${API_BASE}/llm/config`); return handleResponse(res); } @@ -497,7 +505,7 @@ export async function updateLlmConfig( const payload: any = { env_vars, is_active }; if (selected_model) payload.selected_model = selected_model; - const res = await fetch(`${API_BASE}/llm/config/${provider_name}`, { + const res = await apiFetch(`${API_BASE}/llm/config/${provider_name}`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload), diff --git a/frontend/src/main.tsx b/apps/website/src/main.tsx similarity index 100% rename from frontend/src/main.tsx rename to apps/website/src/main.tsx diff --git a/frontend/src/pages/DocsPage.tsx b/apps/website/src/pages/DocsPage.tsx similarity index 97% rename from frontend/src/pages/DocsPage.tsx rename to apps/website/src/pages/DocsPage.tsx index c7f67e5..8c7a885 100644 --- a/frontend/src/pages/DocsPage.tsx +++ b/apps/website/src/pages/DocsPage.tsx @@ -115,7 +115,11 @@ function DocsSidebar() { const DIR_NAMES: Record = { 'cli': 'CLI Commands', - 'ui': 'UI Features' + 'ui': 'UI Features', + 'user-guide': 'User Guide', + 'integration': 'Integration', + 'contributing': 'Contributing', + 'deployment': 'Deployment' }; const groupedDocs: Record = {}; @@ -130,8 +134,8 @@ function DocsSidebar() { groupedDocs[dir].push(doc); }); - // Custom order - const order = ['General', 'CLI Commands', 'UI Features']; + // Custom order - User-centric docs first + const order = ['User Guide', 'Integration', 'Deployment', 'Contributing', 'General', 'CLI Commands', 'UI Features']; const groups = Object.keys(groupedDocs).sort((a, b) => { const indexA = order.indexOf(a); const indexB = order.indexOf(b); diff --git a/frontend/src/pages/ExecutionDetailPage.tsx b/apps/website/src/pages/ExecutionDetailPage.tsx similarity index 100% rename from frontend/src/pages/ExecutionDetailPage.tsx rename to apps/website/src/pages/ExecutionDetailPage.tsx diff --git a/frontend/src/pages/HomePage.tsx b/apps/website/src/pages/HomePage.tsx similarity index 99% rename from frontend/src/pages/HomePage.tsx rename to apps/website/src/pages/HomePage.tsx index 96b8e59..891c314 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/apps/website/src/pages/HomePage.tsx @@ -119,11 +119,11 @@ function KitCard({ /* ── Home Page ─────────────────────────────────────────────────────────── */ export default function HomePage() { - const { user } = useAuth(); + const { user, loading: authLoading } = useAuth(); const [query, setQuery] = useState(''); const [filter, setFilter] = useState<'all' | 'mine'>('all'); const debounceRef = useRef>(undefined); - + // React Query hook for kit list with caching const { data, isLoading, isFetching } = useKitList(query, filter); const kits = data?.kits ?? []; @@ -156,7 +156,7 @@ export default function HomePage() { } }; - const loading = isLoading; + const loading = authLoading || isLoading; const refreshing = isFetching && !isLoading; return ( diff --git a/frontend/src/pages/KitCreatePage.tsx b/apps/website/src/pages/KitCreatePage.tsx similarity index 100% rename from frontend/src/pages/KitCreatePage.tsx rename to apps/website/src/pages/KitCreatePage.tsx diff --git a/frontend/src/pages/KitDetailPage.tsx b/apps/website/src/pages/KitDetailPage.tsx similarity index 100% rename from frontend/src/pages/KitDetailPage.tsx rename to apps/website/src/pages/KitDetailPage.tsx diff --git a/frontend/src/pages/KitHistoryPage.tsx b/apps/website/src/pages/KitHistoryPage.tsx similarity index 100% rename from frontend/src/pages/KitHistoryPage.tsx rename to apps/website/src/pages/KitHistoryPage.tsx diff --git a/frontend/src/pages/KitRunPage.tsx b/apps/website/src/pages/KitRunPage.tsx similarity index 100% rename from frontend/src/pages/KitRunPage.tsx rename to apps/website/src/pages/KitRunPage.tsx diff --git a/frontend/src/pages/LoginPage.tsx b/apps/website/src/pages/LoginPage.tsx similarity index 100% rename from frontend/src/pages/LoginPage.tsx rename to apps/website/src/pages/LoginPage.tsx diff --git a/frontend/src/pages/LogoutPage.tsx b/apps/website/src/pages/LogoutPage.tsx similarity index 100% rename from frontend/src/pages/LogoutPage.tsx rename to apps/website/src/pages/LogoutPage.tsx diff --git a/frontend/src/pages/ResetPasswordPage.tsx b/apps/website/src/pages/ResetPasswordPage.tsx similarity index 100% rename from frontend/src/pages/ResetPasswordPage.tsx rename to apps/website/src/pages/ResetPasswordPage.tsx diff --git a/frontend/src/pages/SettingsPage.tsx b/apps/website/src/pages/SettingsPage.tsx similarity index 100% rename from frontend/src/pages/SettingsPage.tsx rename to apps/website/src/pages/SettingsPage.tsx diff --git a/frontend/src/pages/SignupPage.tsx b/apps/website/src/pages/SignupPage.tsx similarity index 100% rename from frontend/src/pages/SignupPage.tsx rename to apps/website/src/pages/SignupPage.tsx diff --git a/frontend/tailwind.config.js b/apps/website/tailwind.config.js similarity index 100% rename from frontend/tailwind.config.js rename to apps/website/tailwind.config.js diff --git a/frontend/tsconfig.app.json b/apps/website/tsconfig.app.json similarity index 100% rename from frontend/tsconfig.app.json rename to apps/website/tsconfig.app.json diff --git a/frontend/tsconfig.json b/apps/website/tsconfig.json similarity index 100% rename from frontend/tsconfig.json rename to apps/website/tsconfig.json diff --git a/frontend/tsconfig.node.json b/apps/website/tsconfig.node.json similarity index 100% rename from frontend/tsconfig.node.json rename to apps/website/tsconfig.node.json diff --git a/frontend/vite.config.ts b/apps/website/vite.config.ts similarity index 81% rename from frontend/vite.config.ts rename to apps/website/vite.config.ts index 1406734..dab7bac 100644 --- a/frontend/vite.config.ts +++ b/apps/website/vite.config.ts @@ -9,6 +9,7 @@ export default defineConfig({ '/api': { target: 'http://localhost:8000', changeOrigin: true, + credentials: 'include', // Required for session cookies }, }, }, diff --git a/clean_kit.py b/clean_kit.py index a8f1f47..60dfd7d 100644 --- a/clean_kit.py +++ b/clean_kit.py @@ -8,47 +8,46 @@ print("Error: SUPABASE_URL not found in environment!") exit(1) -from clerk.db import get_async_session, ReasoningKitRepository, KitVersionRepository +from openclerk.db import get_async_session, ReasoningKitRepository, KitVersionRepository # noqa: E402 + async def clean_and_create(): async with get_async_session() as session: kits = ReasoningKitRepository(session) versions = KitVersionRepository(session) - + # 1. Delete if exists - old_kit = await kits.get_by_slug('tool-test-kit') + old_kit = await kits.get_by_slug("tool-test-kit") if old_kit: print(f"Deleting existing kit (ID: {old_kit.id})") await kits.delete(old_kit.id) - + # 2. Create fresh kit print("Creating fresh 'Tool Test Kit'") kit = await kits.create( - slug='tool-test-kit', - name='Tool Test Kit', - description='Freshly created for CLI testing', - is_public=True + slug="tool-test-kit", + name="Tool Test Kit", + description="Freshly created for CLI testing", + is_public=True, ) - + print("Creating v1") - version = await versions.create(kit.id, 'Initial clean version') - + version = await versions.create(kit.id, "Initial clean version") + print("Adding tool #1 (read_url)") await versions.add_tool( - version.id, - tool_number=1, - tool_name='read_url', - display_name='URL Reader' + version.id, tool_number=1, tool_name="read_url", display_name="URL Reader" ) - + print("Adding workflow step #1") await versions.add_workflow_step( version.id, step_number=1, - prompt_template='Use {tool_1} to read the content of https://example.com and write a one-paragraph summary of what the page contains.' + prompt_template="Use {tool_1} to read the content of https://example.com and write a one-paragraph summary of what the page contains.", ) - + print("Done!") + if __name__ == "__main__": asyncio.run(clean_and_create()) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..aee4394 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,72 @@ +# Production Docker Compose configuration for Clerk +# Multi-container architecture with database, backend, and frontend services +# Usage: docker-compose up -d + +version: '3.8' + +services: + # PostgreSQL database + db: + image: postgres:16-alpine + container_name: clerk-db + environment: + POSTGRES_USER: ${POSTGRES_USER:-clerk} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-clerk} + POSTGRES_DB: ${POSTGRES_DB:-clerk} + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-clerk}"] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + networks: + - clerk-network + + # Backend API service + backend: + build: + context: . + dockerfile: packages/clerk/Dockerfile + container_name: clerk-backend + env_file: + - .env + environment: + DATABASE_URL: postgresql://${POSTGRES_USER:-clerk}:${POSTGRES_PASSWORD:-clerk}@db:5432/${POSTGRES_DB:-clerk} + depends_on: + db: + condition: service_healthy + healthcheck: + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + restart: unless-stopped + networks: + - clerk-network + + # Frontend web service + frontend: + build: + context: ./apps/website + dockerfile: Dockerfile + container_name: clerk-frontend + ports: + - "${FRONTEND_PORT:-80}:80" + depends_on: + - backend + restart: unless-stopped + networks: + - clerk-network + +# Persistent volume for database +volumes: + postgres_data: + driver: local + +# Network for service communication +networks: + clerk-network: + driver: bridge diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..4d89543 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,57 @@ +# Nginx configuration for Clerk production deployment +# Serves static frontend files and proxies API requests to backend + +server { + listen 80; + server_name localhost; + + # Gzip compression for better performance + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_types + text/plain + text/css + text/xml + text/javascript + application/json + application/javascript + application/xml+rss + application/atom+xml + image/svg+xml; + + # Proxy API requests to backend service + location /api/ { + proxy_pass http://backend:8000; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 86400; + } + + # Serve static files for frontend routes + location / { + root /usr/share/nginx/html; + index index.html; + # SPA routing: fallback to index.html for client-side routes + try_files $uri $uri/ /index.html; + } + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + root /usr/share/nginx/html; + expires 1y; + add_header Cache-Control "public, immutable"; + access_log off; + } +} diff --git a/docs/README.md b/docs/README.md index 7bc6193..53e93e9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,47 +1,34 @@ -# CLERK Documentation +# OpenClerk Documentation -Welcome to the documentation for CLERK (Community Library of Executable Reasoning Kits). +Welcome to the OpenClerk documentation. This documentation is organized for different audiences: -## What is CLERK? +## Quick Links -CLERK (Community Library of Executable Reasoning Kits), commonly referred to as OpenClerk, is a powerful Python framework designed for creating, managing, and executing multi-step LLM reasoning workflows. It includes a modern React frontend for interacting with and visualizing these workflows. +- **New users**: See the [User Guide](#user-guide) to get started with Clerk +- **Developers**: See the [Integration Guide](#integration-guide) to embed Clerk in your application +- **Contributors**: See the [Contributing Guide](#contributing-guide) to help improve Clerk -### Scope and Capabilities -- **Reasoning Kits**: Define complex, multi-step LLM operations using structured instructions, dynamic resources, and evaluation criteria. -- **Agentic Workflows**: Powered by LangChain and LangGraph to manage stateful, multi-agent reasoning chains. -- **Web Interface**: A modern React 19 UI to build, edit, test, and monitor reasoning kits in real-time. -- **CLI Utilities**: Comprehensive command-line tools (`uv run clerk ...`) for running workflows locally, managing tasks, syncing data, and maintaining the database. -- **Extensibility**: Designed to be easily integrated into other applications and augmented with external integrations like MCP (Model Context Protocol). +--- -### How to Use CLERK +## User Guide -**For Human Developers:** -- **Integration**: Embed CLERK as an orchestration engine in your Python backend to manage complex LLM operations. -- **UI Prototyping**: Use the provided React frontend to give end-users a visual way to construct workflows, tweak parameters, and track reasoning steps. -- **Production-Ready**: With Pydantic for data validation and SQLAlchemy/Supabase for asynchronous persistence, the framework is built to be robust for production environments. +For developers who want to use Clerk as a standalone tool or self-host it. -**For AI Coding Agents:** -- **Clear Architecture**: CLERK has strict architectural boundaries (`models.py`, `loader.py`, `graph.py`), making it straightforward for an AI to scaffold new reasoning logic, adjust database models, or create new API routes. -- **Standardized Tooling**: Uses predictable and fast tooling conventions (`uv` for Python dependency management, `pytest` for testing, and `Vite` for the frontend). Agents can quickly build, run, and verify changes reliably. -- **Structured Development Guidelines**: The framework utilizes clear typed Pydantic models and explicit naming conventions (detailed in the `AGENTS.md` guidelines) allowing agents to deterministically parse, create, and update workflows or features. +- [Getting Started](user-guide/getting-started.md) - Installation and first steps +- [Configuration](user-guide/configuration.md) - Environment variables and settings +- [Reasoning Kits](user-guide/reasoning-kits.md) - Creating and running workflows -## Directory +## Integration Guide -- **General** - - [Reasoning Kits](reasoning_kits.md) - - [MCP](mcp.md) - - [Integration Guide](integration.md) +For developers who want to embed Clerk into existing applications. -- **CLI Commands** - - [List Commands](cli/list.md) - - [Run Commands](cli/run.md) - - [Info Command](cli/info.md) - - [Kit Management](cli/kit.md) - - [Sync Commands](cli/sync.md) - - [Database Commands](cli/db.md) - - [Web Command](cli/web.md) +- [FastAPI Integration](integration/fastapi.md) - Using Clerk with FastAPI +- [Embedding Guide](integration/embedding.md) - General embedding patterns +- [API Reference](integration/api.md) - Auto-generated API documentation -- **UI Features** - - [Overview](ui/overview.md) - - [Editing Kits](ui/editing_kits.md) - - [Running Kits](ui/running_kits.md) +## Contributing Guide + +For developers who want to contribute to Clerk. + +- [Setup](contributing/setup.md) - Development environment setup +- [Guidelines](contributing/guidelines.md) - Code style and contribution process diff --git a/docs/contributing/README.md b/docs/contributing/README.md new file mode 100644 index 0000000..f359aca --- /dev/null +++ b/docs/contributing/README.md @@ -0,0 +1,131 @@ +# Contributing to Clerk + +Thank you for your interest in contributing to Clerk! This guide will get you started quickly. + +--- + +## Quick Setup + +The fastest way to get started: + +```bash +# 1. Clone the repository +git clone https://github.com/your-org/clerk.git +cd clerk + +# 2. Run setup (installs dependencies, sets up git hooks) +just setup + +# 3. Start development server +just dev +``` + +That's it! Clerk will be running at: + +- Web UI: `http://localhost:8000` +- API: `http://localhost:8000/api` + +--- + +## Development Workflow + +### 1. Create a Branch + +```bash +git checkout -b feature/my-feature +``` + +### 2. Make Changes + +Edit code, add tests, update documentation as needed. + +### 3. Run Quality Checks + +```bash +# Run all checks (tests, lint, type-check) +just check + +# Or individually: +just test # Run tests +just lint # Run ruff linter +just type # Run mypy type checker +``` + +### 4. Commit + +We use conventional commits: + +```bash +git commit -m "feat: add new feature" +git commit -m "fix: correct bug in parser" +git commit -m "docs: update readme" +``` + +### 5. Push and Create PR + +```bash +git push origin feature/my-feature +``` + +Then open a pull request on GitHub. The CI will run all checks automatically. + +--- + +## What to Contribute + +### Good First Issues + +Look for issues labeled `good first issue` on GitHub. These are: + +- Well-defined and scoped +- Have clear acceptance criteria +- Don't require deep codebase knowledge + +### Areas Needing Help + +- **Documentation:** User guides, API docs, examples +- **Testing:** More test coverage, edge cases +- **Integrations:** Django, Flask examples +- **UI/UX:** Frontend improvements +- **Reasoning Kits:** Example kits for common use cases + +--- + +## Project Structure + +``` +clerk/ +├── apps/ +│ └── website/ # React frontend +├── packages/ +│ └── clerk/ # Python package +│ └── src/openclerk/ +│ ├── cli.py # CLI commands +│ ├── graph.py # Workflow execution +│ ├── loader.py # Kit loading +│ ├── models.py # Data models +│ └── web/ # FastAPI app +├── docs/ # Documentation +├── reasoning_kits/ # Example kits +└── tests/ # Test suite +``` + +--- + +## Getting Help + +- **GitHub Issues:** Bug reports, feature requests +- **GitHub Discussions:** Questions, ideas, general discussion +- **Documentation:** See [Architecture](architecture.md) for system design + +--- + +## Full Contributing Guide + +For detailed guidelines on code style, testing, and the review process, see the root [CONTRIBUTING.md](../../CONTRIBUTING.md). + +--- + +## License + +By contributing, you agree that your contributions will be licensed under the MIT License. diff --git a/docs/contributing/architecture.md b/docs/contributing/architecture.md new file mode 100644 index 0000000..5f78e57 --- /dev/null +++ b/docs/contributing/architecture.md @@ -0,0 +1,309 @@ +# Architecture + +This document describes Clerk's system architecture and design decisions. + +--- + +## Overview + +Clerk is a mono-repo containing: + +- **Backend:** Python FastAPI application with LangGraph workflows +- **Frontend:** React SPA with TypeScript and Tailwind CSS +- **Package:** Installable Python package (`openclerk`) + +### System Diagram + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Clients │ +│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ +│ │ Web UI │ │ CLI │ │ External │ │ +│ │ (React) │ │ (Python) │ │ Apps │ │ +│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ +└─────────┼────────────────┼────────────────┼────────────────┘ + │ │ │ + └────────────────┴────────────────┘ + │ + ┌────────────────┴────────────────┐ + │ OpenClerk API (FastAPI) │ + │ ┌────────────────────────────┐ │ + │ │ Authentication Layer │ │ + │ │ (Session + OAuth) │ │ + │ └────────────────────────────┘ │ + │ ┌────────────────────────────┐ │ + │ │ API Routes │ │ + │ │ /kits, /execute, /docs │ │ + │ └────────────────────────────┘ │ + └────────────────┬────────────────┘ + │ + ┌────────────────┴────────────────┐ + │ Core Services │ + │ ┌──────────┐ ┌──────────┐ │ + │ │ Graph │ │ Loader │ │ + │ │ Engine │ │ │ │ + │ │(LangGraph│ │(Kit I/O) │ │ + │ └────┬─────┘ └────┬─────┘ │ + │ │ │ │ + │ └───────┬───────┘ │ + │ │ │ + │ ┌────┴────┐ │ + │ │ Models │ │ + │ │(Pydantic│ │ + │ └────┬────┘ │ + └───────────────┼─────────────────┘ + │ + ┌───────────────┴───────────────┐ + │ Data Layer (Optional) │ + │ ┌─────────────────────────┐ │ + │ │ Supabase (PostgreSQL) │ │ + │ │ - Kit storage │ │ + │ │ - Version control │ │ + │ │ - User data │ │ + │ └─────────────────────────┘ │ + │ ┌─────────────────────────┐ │ + │ │ Object Storage │ │ + │ │ - Resource files │ │ + │ │ - Kit assets │ │ + │ └─────────────────────────┘ │ + └───────────────────────────────┘ +``` + +--- + +## Backend + +### FastAPI Application + +Location: `packages/clerk/src/openclerk/web/` + +Key components: + +| Component | Purpose | +| ----------------- | ------------------------------------- | +| `app.py` | Application factory, middleware setup | +| `routes/api.py` | API endpoints (kits, execution, auth) | +| `routes/docs.py` | Documentation serving | +| `dependencies.py` | FastAPI dependencies (auth, DB) | + +### Database Layer + +Location: `packages/clerk/src/openclerk/db/` + +Uses SQLAlchemy async with Supabase PostgreSQL: + +- **Models:** SQLAlchemy ORM models (kits, versions, resources, users) +- **Repositories:** Data access pattern (`ReasoningKitRepository`, etc.) +- **Migrations:** Alembic for schema migrations + +Key models: + +```python +# Simplified view +ReasoningKit (id, slug, name, owner_id) + └── KitVersion (id, kit_id, version_number, commit_message) + ├── Resource (version_id, number, filename, storage_path) + └── WorkflowStep (version_id, number, prompt_template) +``` + +### Reasoning Engine + +Location: `packages/clerk/src/openclerk/graph.py` + +Uses LangGraph for workflow execution: + +1. **Parse:** Load kit resources and instructions +2. **Compile:** Build LangGraph state machine +3. **Execute:** Run step-by-step with LLM +4. **Stream:** Yield tokens and progress events + +State flow: + +``` +Input → Resource Loading → Step 1 → Step 2 → ... → Final Output + │ │ │ + └──────────────┴─────────┴────→ Token Stream +``` + +--- + +## Frontend + +Location: `apps/website/` + +### Tech Stack + +- **Framework:** React 19 + TypeScript +- **Build:** Vite +- **Styling:** Tailwind CSS +- **Routing:** React Router +- **UI Components:** Custom + shadcn/ui patterns + +### Project Structure + +``` +apps/website/src/ +├── pages/ # Route components +│ ├── HomePage.tsx # Landing page +│ ├── DocsPage.tsx # Documentation viewer +│ ├── KitsPage.tsx # Kit browser +│ └── KitEditorPage.tsx # Kit creation/editing +├── components/ # Reusable UI +│ ├── ui/ # Base components +│ └── kit-editor/ # Kit-specific components +├── hooks/ # Custom React hooks +│ ├── useAuth.ts # Authentication state +│ └── useToast.ts # Notifications +├── lib/ # Utilities +│ ├── api.ts # API client +│ └── utils.ts # Helpers +└── App.tsx # Router setup +``` + +### Key Pages + +| Page | Route | Purpose | +| ---------- | ------------------ | ------------------------------- | +| Home | `/` | Landing, feature overview | +| Docs | `/docs/*` | Documentation viewer (markdown) | +| Kits | `/kits` | Browse public kits | +| Kit Editor | `/kits/:slug/edit` | Create/edit kits | + +--- + +## Package Structure + +### Mono-repo Layout + +``` +clerk/ +├── apps/ +│ └── website/ # Deployable web app +│ ├── package.json # npm dependencies +│ └── src/ # React source +├── packages/ +│ └── clerk/ # Installable package +│ ├── pyproject.toml # Python dependencies +│ └── src/openclerk/ # Python source +└── docs/ # Documentation (shared) +``` + +### Build Process + +1. **Python Package:** + + ```bash + cd packages/clerk + uv build + ``` + + Creates: `dist/clerk_framework-*.whl` + +2. **Frontend:** + ```bash + cd apps/website + npm run build + ``` + Creates: `dist/` with static assets + +--- + +## Data Flow + +### Reasoning Kit Flow + +``` +1. Authoring Phase + User → Web UI/CLI → API → Database → Storage + +2. Execution Phase + User Request → API → Load Kit → Graph Engine + ↓ + Token Stream ←─ Stream Response ←── LLM Calls + +3. Retrieval Phase + User → API → Database → Storage → Response +``` + +### File vs Database Kits + +| Aspect | File-based | Database | +| ---------- | ---------------- | -------------------- | +| Storage | Local filesystem | PostgreSQL + Storage | +| Versioning | Git | Built-in versioning | +| Sharing | Git/Export | Web UI/Permissions | +| Use case | Development | Production/Teams | + +--- + +## Design Decisions + +### 1. File-First Design + +Kits start as files (easy to version, edit, share) and can be promoted to database for web features. + +### 2. LangGraph for Workflows + +LangGraph provides: + +- Stateful execution +- Streaming support +- Branching/conditional logic (future) +- Ecosystem compatibility + +### 3. FastAPI + React + +- FastAPI: Modern Python, automatic OpenAPI, async support +- React: Component model, TypeScript, large ecosystem + +### 4. Mono-repo + +Single repository for: + +- Backend/frontend in sync +- Shared documentation +- Atomic changes across stack +- Simplified CI/CD + +--- + +## Extension Points + +### Adding New CLI Commands + +Add to `packages/clerk/src/openclerk/cli.py`: + +```python +# Add subparser +my_parser = subparsers.add_parser("my-command", help="Description") +my_parser.add_argument("--flag", help="A flag") + +# Add handler +def _cmd_my_command(args: argparse.Namespace) -> None: + # Implementation + pass +``` + +### Adding API Endpoints + +Add to `packages/clerk/src/openclerk/web/routes/api.py`: + +```python +@router.post("/my-endpoint") +async def my_endpoint(request: Request): + return {"ok": True, "data": ...} +``` + +### Adding Frontend Pages + +1. Create page in `apps/website/src/pages/` +2. Add route in `apps/website/src/App.tsx` +3. Add link in navigation if needed + +--- + +## Learn More + +- **[Contributing Guide](./README.md)** — How to contribute +- **[Backend Code](../../packages/clerk/src/openclerk/)** — Explore the source +- **[Frontend Code](../../apps/website/src/)** — Explore the UI diff --git a/docs/contributing/setup.md b/docs/contributing/setup.md new file mode 100644 index 0000000..04724ec --- /dev/null +++ b/docs/contributing/setup.md @@ -0,0 +1,108 @@ +# Development Setup + +This guide will help you set up a development environment for contributing to Clerk. + +## Prerequisites + +- Python 3.13+ +- Node.js 20+ +- UV (Python package manager) +- Just (task runner) + +## Quick Setup (Recommended) + +Run the automated setup: + +```bash +just setup +``` + +This will: +1. Install Python dependencies via UV +2. Install the package in editable mode +3. Install frontend dependencies + +## Platform-Specific Instructions + +### macOS + +1. Install Homebrew (if not already installed): + ```bash + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + ``` + +2. Install required tools: + ```bash + brew install uv just node + ``` + +3. Clone and setup: + ```bash + git clone https://github.com/simonweigold/clerk.git + cd clerk + just setup + ``` + +### Linux + +1. Install UV: + ```bash + curl -LsSf https://astral.sh/uv/install.sh | sh + ``` + +2. Install Just: + ```bash + curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash + ``` + +3. Install Node.js 20+ (via your package manager or nvm) + +4. Clone and setup: + ```bash + git clone https://github.com/simonweigold/clerk.git + cd clerk + just setup + ``` + +## Dev Container (Zero Setup) + +For a completely automated setup, use the dev container: + +1. Install VS Code with the Dev Containers extension +2. Clone the repository +3. Open in VS Code and click "Reopen in Container" +4. The container will automatically run `just setup` + +Alternatively, use GitHub Codespaces for a browser-based development environment. + +## Verification + +After setup, verify everything works: + +```bash +# Run tests +just test + +# Run linting +just lint + +# Start development servers +just dev +``` + +## Common Issues + +### UV not found +Make sure UV is installed and in your PATH. On macOS with Homebrew, run: +```bash +brew install uv +``` + +### Node modules not found +If frontend dependencies fail to install, try: +```bash +cd apps/website && npm install +``` + +### Port conflicts +The dev servers use ports 3000 (frontend) and 8000 (backend). Make sure these are available or modify the Justfile to use different ports. diff --git a/docs/deployment/docker.md b/docs/deployment/docker.md new file mode 100644 index 0000000..da850c1 --- /dev/null +++ b/docs/deployment/docker.md @@ -0,0 +1,415 @@ +# Docker Compose Deployment + +Deploy Clerk using Docker Compose for a complete, production-ready multi-container setup. + +--- + +## Quick Start + +Get Clerk running in minutes with a single command: + +### Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) 20.10+ installed +- [Docker Compose](https://docs.docker.com/compose/install/) 2.0+ installed +- Git (to clone the repository) + +### One-Command Deployment + +```bash +# Clone the repository +git clone https://github.com/your-org/clerk.git +cd clerk + +# Copy environment template +cp .env.example .env +# Edit .env and add your OPENAI_API_KEY + +# Start all services +docker-compose up +``` + +Once running, access Clerk at: +- **Frontend**: http://localhost (or http://localhost:8080 if FRONTEND_PORT is set) +- **Backend API**: http://localhost:8000 +- **API Documentation**: http://localhost:8000/docs + +To run in background mode: +```bash +docker-compose up -d +``` + +--- + +## Architecture Overview + +Clerk uses a multi-container architecture with three main services: + +``` +┌─────────────────┐ +│ User Request │ +└────────┬────────┘ + │ + ▼ +┌─────────────────┐ ┌─────────────────┐ +│ Frontend │────▶│ Backend │ +│ (React/nginx) │ │ (Python/FastAPI)│ +└─────────────────┘ └────────┬────────┘ + │ + ▼ + ┌─────────────────┐ + │ PostgreSQL │ + │ (Database) │ + └─────────────────┘ +``` + +### Services + +| Service | Technology | Purpose | Port | +|---------|------------|---------|------| +| **db** | PostgreSQL 16 | Persistent data storage | 5432 (internal) | +| **backend** | Python 3.13 + FastAPI | API server, LLM workflows | 8000 | +| **frontend** | React + nginx | Static UI, reverse proxy | 80 (configurable) | + +### Data Flow + +1. **User** accesses the frontend at `http://localhost` +2. **Frontend** (nginx) serves static React files and proxies API calls +3. **Backend** processes requests, runs reasoning workflows via LangChain +4. **Database** persists reasoning kits, evaluations, and user data + +--- + +## Configuration + +### Environment Variables + +All configuration is managed through the `.env` file mounted into containers: + +```bash +# Copy the template +cp .env.example .env + +# Edit with your values +nano .env +``` + +**Key variables to configure:** + +```env +# Required: Your OpenAI API key +OPENAI_API_KEY=sk-... + +# Required: PostgreSQL connection (matches docker-compose defaults) +DATABASE_URL=postgresql://clerk:clerk@db:5432/clerk + +# Optional: Host port for frontend (default: 80) +FRONTEND_PORT=8080 +``` + +See [Environment Variables](./environment.md) for complete documentation. + +### Required Variables + +These must be set before starting: + +| Variable | Description | Example | +|----------|-------------|---------| +| `OPENAI_API_KEY` | OpenAI API access | `sk-...` | +| `DATABASE_URL` | PostgreSQL connection string | `postgresql://clerk:clerk@db:5432/clerk` | + +### Optional Variables + +| Variable | Default | Description | +|----------|---------|-------------| +| `FRONTEND_PORT` | `80` | Host port for accessing the UI | +| `POSTGRES_USER` | `clerk` | Database username | +| `POSTGRES_PASSWORD` | `clerk` | Database password | +| `POSTGRES_DB` | `clerk` | Database name | +| `LOG_LEVEL` | `info` | Application logging level | +| `SECRET_KEY` | auto-generated | Session signing key | + +--- + +## Data Persistence + +### Named Volumes + +PostgreSQL data is stored in a named Docker volume: + +```yaml +# docker-compose.yml +volumes: + postgres_data: + driver: local +``` + +This ensures data persists across container restarts and updates. + +### Backup and Restore + +**Create a backup:** +```bash +# Backup database to file +docker-compose exec db pg_dump -U clerk clerk > backup_$(date +%Y%m%d).sql +``` + +**Restore from backup:** +```bash +# Stop services +docker-compose down + +# Restore database (this will overwrite existing data!) +docker-compose up -d db +docker-compose exec -T db psql -U clerk clerk < backup_20250325.sql + +# Start all services +docker-compose up -d +``` + +**Volume location on host:** +```bash +# Find volume location +docker volume inspect clerk_postgres_data + +# Default location on Linux +/var/lib/docker/volumes/clerk_postgres_data/_data +``` + +### Automatic Backups + +Consider setting up automated backups with a cron job: + +```bash +# Add to crontab (daily at 2 AM) +0 2 * * * cd /path/to/clerk && docker-compose exec -T db pg_dump -U clerk clerk > backups/clerk_$(date +\%Y\%m\%d).sql +``` + +--- + +## Updating + +### Pull Latest Images + +When a new version is released: + +```bash +# Pull latest images +docker-compose pull + +# Restart with new version +docker-compose up -d +``` + +### Database Migrations + +If the update includes database schema changes: + +```bash +# Check for pending migrations +docker-compose exec backend clerk db status + +# Run migrations +docker-compose exec backend clerk db migrate + +# Or restart to auto-run migrations +docker-compose up -d +``` + +### Rolling Back + +If you need to revert: + +```bash +# Stop current version +docker-compose down + +# Restore database from backup (if needed) +docker-compose exec -T db psql -U clerk clerk < backup_before_update.sql + +# Start previous version (specify tag if using versioned images) +docker-compose up -d +``` + +--- + +## Troubleshooting + +### Check Logs + +View logs for all services: +```bash +docker-compose logs -f +``` + +View logs for specific service: +```bash +docker-compose logs -f backend +docker-compose logs -f db +docker-compose logs -f frontend +``` + +### Database Connection Issues + +**Symptom:** Backend fails to connect to database + +**Check:** +```bash +# Verify database is running +docker-compose ps + +# Check database logs +docker-compose logs db + +# Test connection manually +docker-compose exec backend python -c " +import asyncio +from sqlalchemy.ext.asyncio import create_async_engine +async def test(): + engine = create_async_engine('postgresql+asyncpg://clerk:clerk@db:5432/clerk') + async with engine.connect() as conn: + result = await conn.execute('SELECT 1') + print('Connection successful!') +asyncio.run(test()) +" +``` + +**Common fixes:** +- Ensure `DATABASE_URL` in `.env` matches docker-compose database credentials +- Wait for database to fully start before backend attempts connection +- Check that the `db` service is healthy: `docker-compose ps` + +### Port Conflicts + +**Symptom:** "Port is already allocated" error + +**Fix:** Change `FRONTEND_PORT` in `.env`: +```env +FRONTEND_PORT=8080 +``` + +Then restart: +```bash +docker-compose down +docker-compose up -d +``` + +### Permission Denied + +**Symptom:** Cannot write to volumes + +**Fix:** On Linux, ensure your user has Docker permissions: +```bash +# Add user to docker group +sudo usermod -aG docker $USER + +# Re-login or run: +newgrp docker +``` + +### Out of Memory + +**Symptom:** Containers crash with OOM errors + +**Check resource usage:** +```bash +docker stats +``` + +**Minimum recommended resources:** +- 2 CPU cores +- 4 GB RAM +- 10 GB disk space + +--- + +## Advanced Options + +### Running in Background + +Use the `-d` (detach) flag: +```bash +docker-compose up -d +``` + +View logs: +```bash +docker-compose logs -f +``` + +Stop services: +```bash +docker-compose down +``` + +### Scaling Backend Replicas + +For increased load, scale the backend horizontally: + +```bash +# Run 3 backend instances +docker-compose up -d --scale backend=3 +``` + +**Note:** Requires a load balancer or service mesh for request distribution. + +### Custom Networks + +For advanced networking scenarios: + +```yaml +# docker-compose.yml +networks: + clerk_network: + driver: bridge + ipam: + config: + - subnet: 172.20.0.0/16 +``` + +### Health Checks + +Services include built-in health checks: + +```bash +# Check service health +docker-compose ps + +# View health status +docker-compose exec backend curl -f http://localhost:8000/health || echo "Unhealthy" +``` + +### Resource Limits + +Set resource constraints in `docker-compose.yml`: + +```yaml +services: + backend: + deploy: + resources: + limits: + cpus: '1.0' + memory: 1G + reservations: + cpus: '0.5' + memory: 512M +``` + +--- + +## Next Steps + +- Configure [Environment Variables](./environment.md) for your deployment +- Review [Production Considerations](./production.md) before going live +- Set up HTTPS and domain configuration +- Configure automated backups + +--- + +## Reference + +- [Docker Compose Documentation](https://docs.docker.com/compose/) +- [Clerk Environment Variables](./environment.md) +- [Production Deployment Guide](./production.md) +- [`docker-compose.yml` Reference](https://docs.docker.com/compose/compose-file/) diff --git a/docs/deployment/environment.md b/docs/deployment/environment.md new file mode 100644 index 0000000..c235c1b --- /dev/null +++ b/docs/deployment/environment.md @@ -0,0 +1,520 @@ +# Environment Variables Reference + +Complete reference for all Clerk environment variables with descriptions, defaults, and security best practices. + +--- + +## Overview + +Clerk uses environment variables for all configuration. These are loaded from a `.env` file mounted into Docker containers at runtime. + +### How Environment Variables Work + +1. **Create `.env` file**: Copy from `.env.example` template +2. **Mount into containers**: Docker Compose mounts `.env` automatically +3. **Variable substitution**: Values are injected into running containers +4. **Security**: File permissions should be restricted (`chmod 600 .env`) + +### Basic Usage + +```bash +# Copy template +cp .env.example .env + +# Edit with your values +nano .env + +# Protect file permissions (production) +chmod 600 .env +``` + +--- + +## Required Variables + +These variables must be set for Clerk to function properly. + +### OPENAI_API_KEY + +Your OpenAI API key for running LLM reasoning workflows. + +```env +OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx +``` + +| Property | Value | +|----------|-------| +| **Required** | Yes | +| **Default** | None | +| **Format** | `sk-` followed by 48 characters | + +**How to obtain:** +1. Visit [OpenAI Platform](https://platform.openai.com) +2. Sign in or create an account +3. Go to **API Keys** → **Create new secret key** +4. Copy the key immediately (shown only once) + +**Security notes:** +- Never commit this key to version control +- Rotate keys regularly (recommended: every 90 days) +- Use separate keys for development and production +- Monitor usage on the OpenAI dashboard + +--- + +### DATABASE_URL + +PostgreSQL connection string for the backend database. + +```env +# For Docker Compose deployment +DATABASE_URL=postgresql+asyncpg://clerk:clerk@db:5432/clerk + +# For external PostgreSQL +DATABASE_URL=postgresql+asyncpg://user:pass@host:port/dbname +``` + +| Property | Value | +|----------|-------| +| **Required** | Yes | +| **Default** | None | +| **Format** | `postgresql+asyncpg://user:password@host:port/database` | + +**Format breakdown:** +- `postgresql+asyncpg://` — Protocol (asyncpg driver required) +- `user:password` — Authentication credentials +- `@host:port` — Server address and port +- `/database` — Database name + +**Docker Compose example:** +```env +DATABASE_URL=postgresql+asyncpg://clerk:clerk@db:5432/clerk +``` + +This connects to the `db` service defined in `docker-compose.yml`. + +--- + +## Application Variables + +### CLERK_SESSION_SECRET + +Secret key for signing session cookies and CSRF tokens. + +```env +CLERK_SESSION_SECRET=your-secret-key-here +``` + +| Property | Value | +|----------|-------| +| **Required** | Yes (auto-generated if missing) | +| **Default** | `clerk-session-secret-change-in-production` | +| **Format** | String, minimum 32 characters recommended | + +**Generate a secure key:** +```bash +# Using OpenSSL +openssl rand -hex 32 + +# Using Python +python -c "import secrets; print(secrets.token_hex(32))" +``` + +**Security notes:** +- Must be kept secret in production +- Change from default immediately +- Use different keys for different environments +- Rotate if compromised + +--- + +### LOG_LEVEL + +Application logging verbosity level. + +```env +LOG_LEVEL=info +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | `info` | +| **Options** | `debug`, `info`, `warning`, `error`, `critical` | + +**Level descriptions:** + +| Level | Description | Use Case | +|-------|-------------|----------| +| `debug` | Detailed debug information | Development, troubleshooting | +| `info` | General operational events | Normal production operation | +| `warning` | Unexpected but handled issues | Minor issues, deprecated features | +| `error` | Errors that affect functionality | Errors requiring attention | +| `critical` | Serious errors, application failure | Immediate action required | + +--- + +## Optional Integrations + +### Supabase Configuration + +Supabase provides managed PostgreSQL, authentication, and storage. Clerk can use Supabase instead of local PostgreSQL. + +#### SUPABASE_URL + +Your Supabase project URL. + +```env +SUPABASE_URL=https://abcdefghijklmnop.supabase.co +``` + +| Property | Value | +|----------|-------| +| **Required** | No (for Supabase mode) | +| **Default** | None | +| **Format** | `https://project-ref.supabase.co` | + +**How to find:** +1. Go to [Supabase Dashboard](https://app.supabase.com) +2. Select your project +3. Go to **Project Settings** → **API** +4. Copy **Project URL** + +--- + +#### SUPABASE_ANON_KEY + +Supabase anonymous/public key for client-side operations. + +```env +SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIs... +``` + +| Property | Value | +|----------|-------| +| **Required** | No (for Supabase mode) | +| **Default** | None | +| **Format** | JWT token string | + +**How to find:** +1. Supabase Dashboard → **Project Settings** → **API** +2. Copy **anon public** key + +--- + +#### SUPABASE_SERVICE_ROLE_KEY + +Supabase service role key for admin operations. + +```env +SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIs... +``` + +| Property | Value | +|----------|-------| +| **Required** | No (recommended for Supabase mode) | +| **Default** | None | +| **Format** | JWT token string | + +**⚠️ Security Warning:** +- This key has full admin access to your Supabase project +- Never expose in client-side code +- Never commit to version control +- Use only in server-side/backend code + +**How to find:** +1. Supabase Dashboard → **Project Settings** → **API** +2. Copy **service_role secret** key + +--- + +#### Supabase vs Local PostgreSQL + +| Feature | Local PostgreSQL | Supabase | +|---------|------------------|----------| +| **Setup** | Docker Compose | Cloud service | +| **Maintenance** | Self-managed | Managed | +| **Backups** | Manual setup | Automatic | +| **Scaling** | Manual | Automatic | +| **Auth** | Clerk built-in | Supabase Auth | +| **Storage** | Local filesystem | Supabase Storage | +| **Best for** | Self-hosted, development | Cloud deployments | + +--- + +## Docker Compose Variables + +These variables configure the Docker Compose environment itself. + +### POSTGRES_USER + +PostgreSQL superuser username. + +```env +POSTGRES_USER=clerk +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | `clerk` | + +--- + +### POSTGRES_PASSWORD + +PostgreSQL superuser password. + +```env +POSTGRES_PASSWORD=clerk +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | `clerk` | + +**Security note:** Change default in production: +```bash +# Generate secure password +openssl rand -base64 32 +``` + +--- + +### POSTGRES_DB + +Default database name created on startup. + +```env +POSTGRES_DB=clerk +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | `clerk` | + +--- + +### FRONTEND_PORT + +Host port for accessing the frontend application. + +```env +FRONTEND_PORT=80 +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | `80` | +| **Range** | 1-65535 | + +**Common values:** +- `80` — Standard HTTP port (requires root/admin on Linux/Mac) +- `8080` — Alternative HTTP port +- `3000` — Common development port + +**Note:** If port is already in use, Docker will report an error. Change to an available port. + +--- + +## Frontend Variables + +### VITE_API_URL + +Backend API URL for the frontend to communicate with. + +```env +VITE_API_URL=http://localhost:8000 +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | `http://localhost:8000` | +| **Format** | Full URL with protocol | + +**Development:** +```env +VITE_API_URL=http://localhost:8000 +``` + +**Production (with HTTPS):** +```env +VITE_API_URL=https://api.yourdomain.com +``` + +--- + +## Additional Variables + +### CLERK_EMAIL / CLERK_PASSWORD + +Credentials for testing purposes. + +```env +CLERK_EMAIL=admin@example.com +CLERK_PASSWORD=secure-password +``` + +| Property | Value | +|----------|-------| +| **Required** | No | +| **Default** | None | +| **Use** | Development/testing only | + +--- + +## Security Considerations + +### File Permissions + +Protect your `.env` file from unauthorized access: + +```bash +# Set restrictive permissions (owner read/write only) +chmod 600 .env + +# Verify permissions +ls -la .env +# -rw------- 1 user user 1234 Mar 25 10:00 .env +``` + +### Version Control + +**Never commit `.env` to git:** + +```bash +# Ensure .env is ignored +echo ".env" >> .gitignore + +# Verify it's not tracked +git status +``` + +The `.env.example` template (without secrets) should be committed instead. + +### Secret Rotation + +Rotate secrets regularly: + +| Secret Type | Rotation Frequency | How to Rotate | +|-------------|-------------------|---------------| +| `OPENAI_API_KEY` | Every 90 days | Generate new key in OpenAI dashboard | +| `CLERK_SESSION_SECRET` | Every 180 days | Generate new secret, restart containers | +| `POSTGRES_PASSWORD` | Every 180 days | Change in `.env`, restart services | +| `SUPABASE_SERVICE_ROLE_KEY` | Every 90 days | Regenerate in Supabase dashboard | + +### Production Checklist + +- [ ] Changed default `CLERK_SESSION_SECRET` +- [ ] Changed default `POSTGRES_PASSWORD` +- [ ] Set `LOG_LEVEL` to `info` or `warning` +- [ ] Set `.env` file permissions to `600` +- [ ] Added `.env` to `.gitignore` +- [ ] Using HTTPS for `VITE_API_URL` in production +- [ ] Rotated all API keys from development values + +--- + +## Quick Reference Table + +| Variable | Required | Default | Description | +|----------|----------|---------|-------------| +| `OPENAI_API_KEY` | Yes | — | OpenAI API access key | +| `DATABASE_URL` | Yes | — | PostgreSQL connection string | +| `CLERK_SESSION_SECRET` | Yes | `clerk-session-secret...` | Session signing key | +| `LOG_LEVEL` | No | `info` | Application logging level | +| `SUPABASE_URL` | No | — | Supabase project URL | +| `SUPABASE_ANON_KEY` | No | — | Supabase public key | +| `SUPABASE_SERVICE_ROLE_KEY` | No | — | Supabase admin key | +| `POSTGRES_USER` | No | `clerk` | Database username | +| `POSTGRES_PASSWORD` | No | `clerk` | Database password | +| `POSTGRES_DB` | No | `clerk` | Database name | +| `FRONTEND_PORT` | No | `80` | Host port for UI | +| `VITE_API_URL` | No | `http://localhost:8000` | Backend API URL | +| `CLERK_EMAIL` | No | — | Test credentials | +| `CLERK_PASSWORD` | No | — | Test credentials | + +--- + +## Example Production .env + +```env +# ============================================================================= +# Production Environment Configuration +# ============================================================================= + +# Required: API Keys +OPENAI_API_KEY=sk-prod-xxxxxxxxxxxxxxxxxxxxxxxx + +# Required: Database (use connection pooler in production) +DATABASE_URL=postgresql+asyncpg://clerk:secure-db-password@db:5432/clerk + +# Required: Session Security (generate with: openssl rand -hex 32) +CLERK_SESSION_SECRET=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6 + +# Logging +LOG_LEVEL=info + +# Frontend +FRONTEND_PORT=443 +VITE_API_URL=https://api.clerk.example.com + +# Database Credentials (change defaults!) +POSTGRES_USER=clerk_prod +POSTGRES_DB=clerk_prod +POSTGRES_PASSWORD=complex-password-generated-with-openssl + +# Optional: Supabase (if using instead of local PostgreSQL) +# SUPABASE_URL=https://your-project.supabase.co +# SUPABASE_ANON_KEY=eyJhbG... +# SUPABASE_SERVICE_ROLE_KEY=eyJhbG... +``` + +--- + +## Troubleshooting + +### Variable Not Found + +**Error:** `KeyError: 'OPENAI_API_KEY'` or similar + +**Fix:** +1. Check `.env` file exists in project root +2. Verify variable name spelling +3. Ensure no spaces around `=` sign +4. Restart containers: `docker-compose restart` + +### Connection Refused + +**Error:** Database or API connection failures + +**Fix:** +1. Verify `DATABASE_URL` format (must use `postgresql+asyncpg://`) +2. Check host matches service name in docker-compose (e.g., `db`) +3. Ensure database credentials match `POSTGRES_*` variables + +### Port Already in Use + +**Error:** `Bind for 0.0.0.0:80 failed: port is already allocated` + +**Fix:** +```bash +# Change FRONTEND_PORT in .env +FRONTEND_PORT=8080 + +# Restart +docker-compose down +docker-compose up -d +``` + +--- + +## Related Documentation + +- [Docker Compose Deployment](./docker.md) +- [Production Considerations](./production.md) +- [`.env.example` Template](../../.env.example) diff --git a/docs/deployment/production.md b/docs/deployment/production.md new file mode 100644 index 0000000..361f3b8 --- /dev/null +++ b/docs/deployment/production.md @@ -0,0 +1,739 @@ +# Production Deployment Guide + +Best practices for deploying Clerk in production environments with HTTPS, security hardening, scaling, and monitoring. + +--- + +## HTTPS Setup + +HTTPS is **essential** for production deployments to protect sensitive data and API keys in transit. + +### Option 1: Reverse Proxy (Recommended) + +Use nginx, Traefik, or Caddy as a reverse proxy with SSL termination. + +#### nginx Configuration + +```nginx +# /etc/nginx/sites-available/clerk +server { + listen 80; + server_name clerk.example.com; + return 301 https://$server_name$request_uri; +} + +server { + listen 443 ssl http2; + server_name clerk.example.com; + + # SSL certificates + ssl_certificate /etc/letsencrypt/live/clerk.example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/clerk.example.com/privkey.pem; + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + + # Frontend + location / { + proxy_pass http://localhost:80; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # Backend API + location /api/ { + proxy_pass http://localhost:8000/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} +``` + +**Enable configuration:** +```bash +sudo ln -s /etc/nginx/sites-available/clerk /etc/nginx/sites-enabled/ +sudo nginx -t +sudo systemctl reload nginx +``` + +#### Traefik Configuration (Docker Compose) + +```yaml +# docker-compose.yml +services: + traefik: + image: traefik:v3.0 + command: + - "--api.insecure=true" + - "--providers.docker=true" + - "--entrypoints.web.address=:80" + - "--entrypoints.websecure.address=:443" + - "--certificatesresolvers.letsencrypt.acme.tlschallenge=true" + - "--certificatesresolvers.letsencrypt.acme.email=admin@example.com" + - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" + ports: + - "80:80" + - "443:443" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "./letsencrypt:/letsencrypt" + + frontend: + labels: + - "traefik.enable=true" + - "traefik.http.routers.frontend.rule=Host(`clerk.example.com`)" + - "traefik.http.routers.frontend.entrypoints=websecure" + - "traefik.http.routers.frontend.tls.certresolver=letsencrypt" +``` + +### Option 2: Let's Encrypt Certificates + +**Using Certbot:** +```bash +# Install Certbot +sudo apt install certbot python3-certbot-nginx + +# Obtain certificate +sudo certbot --nginx -d clerk.example.com + +# Auto-renewal (automatically configured) +sudo certbot renew --dry-run +``` + +**Using acme.sh:** +```bash +# Install acme.sh +curl https://get.acme.sh | sh + +# Issue certificate +~/.acme.sh/acme.sh --issue -d clerk.example.com --nginx + +# Install certificate +~/.acme.sh/acme.sh --install-cert -d clerk.example.com \ + --key-file /etc/nginx/ssl/clerk.key \ + --fullchain-file /etc/nginx/ssl/clerk.crt \ + --reloadcmd "systemctl reload nginx" +``` + +### Option 3: Cloudflare Proxy + +Use Cloudflare as a CDN and SSL provider: + +1. **Add your domain to Cloudflare** +2. **Update DNS** to point to Cloudflare +3. **Enable SSL/TLS**: + - SSL/TLS mode: **Full (strict)** + - Always Use HTTPS: **On** + - Automatic HTTPS Rewrites: **On** +4. **Update VITE_API_URL**: + ```env + VITE_API_URL=https://clerk.example.com/api + ``` + +### Updating VITE_API_URL for HTTPS + +After setting up HTTPS, update the frontend environment variable: + +```env +# Before (HTTP) +VITE_API_URL=http://localhost:8000 + +# After (HTTPS) +VITE_API_URL=https://clerk.example.com/api +``` + +Then rebuild and restart: +```bash +docker-compose down +docker-compose up -d --build +``` + +--- + +## Database Security + +### Strong Passwords + +Generate secure database passwords: + +```bash +# Generate strong password +openssl rand -base64 32 + +# Update .env +POSTGRES_PASSWORD=your-generated-password +``` + +### Network Isolation + +**Never expose PostgreSQL port (5432) publicly.** + +Verify in `docker-compose.yml`: +```yaml +services: + db: + # Do NOT add ports section for production + # ports: + # - "5432:5432" # ❌ Never do this in production + + # Only internal network access + networks: + - clerk_network +``` + +### Regular Backups + +**Automated backup script:** +```bash +#!/bin/bash +# /opt/clerk/backup.sh + +BACKUP_DIR="/backups/clerk" +DATE=$(date +%Y%m%d_%H%M%S) +FILENAME="clerk_backup_${DATE}.sql" + +# Create backup +docker-compose exec -T db pg_dump -U clerk clerk > "${BACKUP_DIR}/${FILENAME}" + +# Compress +gzip "${BACKUP_DIR}/${FILENAME}" + +# Keep only last 30 days +find "${BACKUP_DIR}" -name "clerk_backup_*.sql.gz" -mtime +30 -delete + +# Optional: Encrypt backup +gpg --symmetric --cipher-algo AES256 "${BACKUP_DIR}/${FILENAME}.gz" +rm "${BACKUP_DIR}/${FILENAME}.gz" +``` + +**Cron job for daily backups:** +```bash +# Edit crontab +sudo crontab -e + +# Add line for daily 2 AM backup +0 2 * * * /opt/clerk/backup.sh >> /var/log/clerk-backup.log 2>&1 +``` + +### Backup Encryption + +Encrypt backups before storing offsite: + +```bash +# Encrypt with GPG +gpg --symmetric --cipher-algo AES256 backup.sql + +# Decrypt when needed +gpg --decrypt backup.sql.gpg > backup.sql +``` + +### Point-in-Time Recovery + +Enable PostgreSQL WAL archiving for point-in-time recovery: + +```yaml +services: + db: + command: > + postgres + -c wal_level=replica + -c archive_mode=on + -c archive_command='test ! -f /backups/wal/%f && cp %p /backups/wal/%f' +``` + +--- + +## Application Security + +### Strong SECRET_KEY + +Generate a cryptographically secure session key: + +```bash +# Recommended: 64 characters (32 bytes hex) +openssl rand -hex 32 +``` + +Update `.env`: +```env +CLERK_SESSION_SECRET=a1b2c3d4e5f6...64-char-hex-string +``` + +### OPENAI_API_KEY Protection + +- Store in `.env` file with `chmod 600` permissions +- Rotate keys every 90 days +- Use separate keys for dev/staging/production +- Monitor usage on OpenAI dashboard +- Set up spending alerts + +### Rate Limiting + +Consider adding rate limiting at the reverse proxy level: + +```nginx +# nginx rate limiting +limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s; +limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s; + +server { + location /api/ { + limit_req zone=api burst=20 nodelay; + proxy_pass http://backend; + } + + location /api/auth/ { + limit_req zone=login burst=5 nodelay; + proxy_pass http://backend; + } +} +``` + +### Input Validation + +Clerk includes built-in input validation via Pydantic models. Ensure: +- Validation schemas are up to date +- Error messages don't leak sensitive info +- File uploads have size and type restrictions + +### Security Headers + +The frontend nginx configuration already includes security headers: + +```nginx +add_header X-Frame-Options "SAMEORIGIN" always; +add_header X-Content-Type-Options "nosniff" always; +add_header X-XSS-Protection "1; mode=block" always; +add_header Referrer-Policy "strict-origin-when-cross-origin" always; +add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';" always; +``` + +--- + +## Scaling Considerations + +### Horizontal Scaling: Backend Replicas + +Scale backend horizontally by running multiple instances: + +```yaml +services: + backend: + deploy: + replicas: 3 + environment: + - DATABASE_URL=postgresql+asyncpg://clerk:pass@db:5432/clerk +``` + +**Note:** Requires sticky sessions or stateless authentication for WebSocket support. + +### Database Read Replicas + +For read-heavy workloads, consider PostgreSQL read replicas: + +```yaml +services: + backend: + environment: + - DATABASE_URL=postgresql+asyncpg://clerk:pass@db-primary:5432/clerk + - DATABASE_READ_URL=postgresql+asyncpg://clerk:pass@db-replica:5432/clerk +``` + +### Connection Pooling with PgBouncer + +Add PgBouncer to reduce database connection overhead: + +```yaml +services: + pgbouncer: + image: pgbouncer/pgbouncer:latest + environment: + DATABASES_HOST: db + DATABASES_PORT: 5432 + DATABASES_DATABASE: clerk + POOL_MODE: transaction + MAX_CLIENT_CONN: 1000 + DEFAULT_POOL_SIZE: 25 +``` + +### Load Balancing + +**nginx upstream configuration:** +```nginx +upstream backend { + least_conn; + server backend1:8000; + server backend2:8000; + server backend3:8000; + keepalive 32; +} + +server { + location /api/ { + proxy_pass http://backend; + } +} +``` + +### When to Scale vs Optimize + +| Metric | Threshold | Action | +|--------|-----------|--------| +| CPU > 80% | Sustained 5 min | Scale up replicas | +| Memory > 80% | Sustained 5 min | Optimize or scale | +| DB connections > 80% | Peak hours | Add PgBouncer | +| Response time > 500ms | P95 | Optimize queries | +| Error rate > 1% | Any | Investigate bugs | + +--- + +## Monitoring & Logging + +### Centralized Logging + +Forward container logs to external system: + +```yaml +services: + backend: + logging: + driver: "fluentd" + options: + fluentd-address: localhost:24224 + tag: clerk.backend +``` + +**Docker logging drivers:** +- `json-file` (default) +- `syslog` +- `journald` +- `fluentd` +- `awslogs` +- `gcplogs` + +### Health Check Endpoints + +Clerk provides health check endpoints: + +```bash +# Liveness probe +curl -f http://localhost:8000/health/live || echo "Not live" + +# Readiness probe +curl -f http://localhost:8000/health/ready || echo "Not ready" + +# Full health check +curl http://localhost:8000/health +``` + +**Docker Compose health checks:** +```yaml +services: + backend: + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s +``` + +### Metrics Collection + +Export metrics to Prometheus: + +```yaml +services: + backend: + environment: + - METRICS_ENABLED=true + - METRICS_PORT=9090 +``` + +**Prometheus scrape configuration:** +```yaml +scrape_configs: + - job_name: 'clerk' + static_configs: + - targets: ['clerk:9090'] +``` + +### Alerting + +**Prometheus AlertManager example:** +```yaml +groups: + - name: clerk + rules: + - alert: ClerkHighErrorRate + expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.05 + for: 5m + labels: + severity: critical + annotations: + summary: "High error rate detected" + + - alert: ClerkDown + expr: up{job="clerk"} == 0 + for: 1m + labels: + severity: critical +``` + +### Log Retention + +Set log retention policies: + +```yaml +services: + backend: + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "5" +``` + +--- + +## Updates & Maintenance + +### Zero-Downtime Deployments + +Use blue-green deployment or rolling updates: + +```bash +# Rolling update +docker-compose up -d --no-deps --build backend + +# Verify new version +curl -f http://localhost:8000/health + +# If failed, rollback +docker-compose up -d --no-deps backend-previous +``` + +### Database Migration Strategy + +**Pre-deployment:** +```bash +# Test migrations in staging +docker-compose -f docker-compose.staging.yml exec backend clerk db migrate +``` + +**Production deployment:** +```bash +# 1. Backup database first +./backup.sh + +# 2. Run migrations +docker-compose exec backend clerk db migrate + +# 3. Deploy new code +docker-compose up -d --build + +# 4. Verify +curl -f http://localhost:8000/health +``` + +### Rollback Procedures + +**Code rollback:** +```bash +# Revert to previous image tag +docker-compose down +docker-compose -f docker-compose.yml -f docker-compose.previous.yml up -d +``` + +**Database rollback:** +```bash +# Restore from backup +docker-compose down +docker-compose up -d db +docker-compose exec -T db psql -U clerk clerk < backup_before_migration.sql +``` + +### Version Pinning + +Pin Docker images to specific versions: + +```yaml +services: + db: + image: postgres:16.2-alpine # Pin to minor version + + backend: + image: clerk/backend:v1.2.3 # Pin to exact version +``` + +--- + +## Resource Planning + +### Minimum Requirements + +| Resource | Minimum | Recommended | +|----------|---------|-------------| +| CPU | 2 cores | 4 cores | +| RAM | 4 GB | 8 GB | +| Disk | 20 GB SSD | 50 GB SSD | +| Network | 100 Mbps | 1 Gbps | + +### PostgreSQL Memory Tuning + +Optimize PostgreSQL for available memory: + +```yaml +services: + db: + command: > + postgres + -c shared_buffers=2GB + -c effective_cache_size=6GB + -c maintenance_work_mem=512MB + -c work_mem=16MB + -c max_connections=200 +``` + +**Memory allocation guide:** + +| Total RAM | shared_buffers | effective_cache_size | +|-----------|----------------|---------------------| +| 4 GB | 1 GB | 3 GB | +| 8 GB | 2 GB | 6 GB | +| 16 GB | 4 GB | 12 GB | +| 32 GB | 8 GB | 24 GB | + +### Connection Limits + +Adjust connection limits based on expected load: + +```yaml +services: + db: + command: > + postgres + -c max_connections=200 + -c superuser_reserved_connections=3 +``` + +**Connection formula:** +``` +max_connections = (backend_replicas × connection_pool_size) + buffer + = (3 × 20) + 20 = 80 +``` + +### Storage Growth Estimation + +Estimate disk space requirements: + +| Data Type | Size Estimate | Growth Rate | +|-----------|---------------|-------------| +| Base installation | 2 GB | Fixed | +| PostgreSQL data | 1 GB per 10k kits | +10% monthly | +| Logs | 100 MB/day | Rotated | +| Backups | 2x database size | Weekly full + daily incremental | + +**Formula:** +``` +Total Storage = Base + (DB Size × 3) + (Logs × Retention) + = 2 GB + (10 GB × 3) + (100 MB × 30) + = 35 GB minimum +``` + +--- + +## Production Checklist + +### Pre-Deployment + +- [ ] Environment variables configured +- [ ] `.env` file permissions set to `600` +- [ ] Strong passwords generated for database +- [ ] `CLERK_SESSION_SECRET` changed from default +- [ ] HTTPS configured with valid SSL certificate +- [ ] Domain DNS configured correctly +- [ ] Firewall rules configured (only 80/443 exposed) +- [ ] Database backups tested + +### Post-Deployment + +- [ ] Health check endpoints responding +- [ ] Frontend loads without mixed content warnings +- [ ] API requests succeed (test with curl) +- [ ] WebSocket connections working +- [ ] Login/logout functionality working +- [ ] File uploads working +- [ ] Error pages displaying correctly + +### Monitoring Verification + +- [ ] Log aggregation working +- [ ] Metrics collection active +- [ ] Alerting rules tested +- [ ] Dashboards configured +- [ ] On-call rotation established + +### Backup Verification + +- [ ] Automated backups running +- [ ] Backup files being created +- [ ] Backup restoration tested +- [ ] Offsite backup configured +- [ ] Backup encryption working + +### Security Verification + +- [ ] SSL Labs A+ rating achieved +- [ ] Security headers present +- [ ] Rate limiting active +- [ ] No sensitive data in logs +- [ ] Database port not exposed +- [ ] File permissions correct + +--- + +## Environment File Security + +Protect your `.env` file with proper permissions: + +```bash +# Set owner-only read/write permissions +chmod 600 .env + +# Verify permissions +ls -la .env +# Output should show: -rw------- + +# Ensure correct ownership +sudo chown $USER:$USER .env +``` + +**What `chmod 600` means:** +- Owner: read and write (6 = 4+2) +- Group: no permissions (0) +- Others: no permissions (0) + +**Verify in deployment:** +```bash +# Check on production server +ssh user@server "ls -la /opt/clerk/.env" +# Should show: -rw------- 1 clerk clerk +``` + +--- + +## Related Documentation + +- [Docker Compose Deployment](./docker.md) +- [Environment Variables](./environment.md) +- [Let's Encrypt Documentation](https://letsencrypt.org/docs/) +- [PostgreSQL Security Guide](https://www.postgresql.org/docs/current/security.html) +- [Docker Security Best Practices](https://docs.docker.com/engine/security/) diff --git a/docs/integration/README.md b/docs/integration/README.md new file mode 100644 index 0000000..74ac7b0 --- /dev/null +++ b/docs/integration/README.md @@ -0,0 +1,222 @@ +# Integration Guide + +This guide helps you embed Clerk into your existing applications. Whether you're building with FastAPI, Django, or Flask, Clerk can integrate seamlessly into your stack. + +--- + +## When to Embed Clerk + +### Use Clerk as a standalone tool when: + +- You want a ready-to-use web UI +- You're self-hosting and need the full experience +- Your team wants to author and manage reasoning kits + +### Embed Clerk when: + +- You have an existing application and want to add reasoning capabilities +- You need Clerk's workflow engine without the UI +- You want to expose reasoning kits via your own API endpoints +- You're building a SaaS and want white-labeled reasoning workflows + +--- + +## FastAPI Integration + +FastAPI is the recommended way to embed Clerk due to its native ASGI support and shared ecosystem. + +### Step 1: Install Clerk + +```bash +pip install openclerk +``` + +### Step 2: Import and Mount + +```python +from fastapi import FastAPI +from openclerk.web.app import create_app as create_clerk_app + +# Your existing FastAPI app +app = FastAPI(title="My Application") + +# Create Clerk app +clerk_app = create_clerk_app() + +# Mount Clerk at a subpath +app.mount("/clerk", clerk_app) +``` + +### Step 3: Configure Environment Variables + +Create a `.env` file or set environment variables: + +```bash +# Required for LLM operations +OPENAI_API_KEY=sk-... + +# Optional: Database (Supabase) +DATABASE_URL=postgresql://... +SUPABASE_URL=https://... +SUPABASE_SERVICE_KEY=... + +# Optional: Session secret for auth +SESSION_SECRET_KEY=your-secret-key +``` + +### Step 4: Authentication Setup + +Clerk uses session-based authentication. If your app already has auth, you can synchronize users: + +```python +from openclerk.web.dependencies import get_optional_user + +@app.get("/api/my-endpoint") +async def my_endpoint(user: dict | None = Depends(get_optional_user)): + if not user: + return {"error": "Authentication required"} + # Your logic here +``` + +### Complete Example + +```python +# main.py +from fastapi import FastAPI, Depends +from openclerk.web.app import create_app as create_clerk_app +from openclerk.web.dependencies import get_optional_user + +app = FastAPI(title="My App with Clerk") + +# Mount Clerk +clerk_app = create_clerk_app() +app.mount("/clerk", clerk_app) + +# Your custom routes +@app.get("/api/status") +async def status(): + return {"status": "ok"} + +@app.get("/api/user-kits") +async def user_kits(user: dict | None = Depends(get_optional_user)): + if not user: + return {"error": "Not authenticated"} + # Return user's kits + return {"kits": []} + +if __name__ == "__main__": + import uvicorn + uvicorn.run(app, host="0.0.0.0", port=8000) +``` + +Run it: + +```bash +uvicorn main:app --reload +``` + +Access Clerk at: `http://localhost:8000/clerk` + +--- + +## Accessing Clerk's API + +Once mounted, Clerk's full API is available under the mount path: + +| Endpoint | Description | +| ------------------------------------- | --------------------- | +| `GET /clerk/api/kits` | List available kits | +| `POST /clerk/api/kits` | Create a new kit | +| `GET /clerk/api/kits/{slug}` | Get kit details | +| `POST /clerk/api/kits/{slug}/execute` | Execute a kit | +| `GET /clerk/api/openapi.json` | OpenAPI specification | + +See the [API Reference](api-reference.md) for complete documentation. + +--- + +## Custom Integration Patterns + +### Direct Graph Execution + +For programmatic use without the web API: + +```python +from openclerk.loader import load_reasoning_kit +from openclerk.graph import run_reasoning_kit + +# Load a kit +kit = load_reasoning_kit("./reasoning_kits/my-kit") + +# Run it +result = run_reasoning_kit(kit) +print(result) +``` + +### Database-Only Mode + +If you only need database operations without the web layer: + +```python +from openclerk.db import get_async_session, ReasoningKitRepository + +async def get_kits(): + async with get_async_session() as session: + repo = ReasoningKitRepository(session) + kits = await repo.list_public() + return kits +``` + +--- + +## Other Frameworks + +While FastAPI is recommended, you can integrate Clerk with other frameworks: + +### Django + +Use Clerk's async database layer and graph execution directly: + +```python +# views.py +from django.http import JsonResponse +from openclerk.loader import load_reasoning_kit +from openclerk.graph import run_reasoning_kit + +async def run_kit(request, kit_name): + kit = load_reasoning_kit(f"./kits/{kit_name}") + result = await run_reasoning_kit(kit) + return JsonResponse({"result": result}) +``` + +### Flask + +Similar approach using Flask's async support: + +```python +from flask import Flask +from openclerk.loader import load_reasoning_kit +from openclerk.graph import run_reasoning_kit + +app = Flask(__name__) + +@app.route("/run/") +async def run_kit(kit_name): + kit = load_reasoning_kit(f"./kits/{kit_name}") + result = await run_reasoning_kit(kit) + return {"result": result} +``` + +--- + +## Next Steps + +- **[API Reference](api-reference.md)** — Complete API documentation +- **[Integration Examples](examples.md)** — Working code examples +- See the FastAPI integration example in `examples/fastapi-integration/` + +--- + +## Reference + +See requirement **INTEG-01** for the detailed embedding specification. diff --git a/docs/integration/api-reference.md b/docs/integration/api-reference.md new file mode 100644 index 0000000..d18f282 --- /dev/null +++ b/docs/integration/api-reference.md @@ -0,0 +1,176 @@ +# API Reference + +Complete reference for Clerk's REST API. + +--- + +## OpenAPI Specification + +Clerk provides a complete OpenAPI 3.0 specification that describes all available endpoints, request/response schemas, and authentication requirements. + +### Accessing the Spec + +The OpenAPI specification is available at: + +``` +GET /api/openapi.json +``` + +Fetch it with curl: + +```bash +curl http://localhost:8000/api/openapi.json | jq . +``` + +Or download it: + +```bash +curl http://localhost:8000/api/openapi.json -o openapi.json +``` + +### Using the Spec + +The OpenAPI spec enables: + +- **Postman:** Import the spec to create a complete collection +- **Swagger UI:** Load the spec in Swagger Editor for interactive docs +- **Client Generation:** Generate typed API clients for any language +- **Testing:** Validate requests/responses against the schema + +### Postman Import + +1. Open Postman +2. Click **Import** → **Link** +3. Enter: `http://localhost:8000/api/openapi.json` +4. Click **Import** + +### Swagger UI + +Visit Swagger's online editor and paste the spec URL: + +``` +https://editor.swagger.io/?url=http://localhost:8000/api/openapi.json +``` + +--- + +## Key Endpoints + +### Kits + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/kits` | List all public kits | +| `POST` | `/api/kits` | Create a new kit | +| `GET` | `/api/kits/{slug}` | Get kit details | +| `PUT` | `/api/kits/{slug}` | Update kit metadata | +| `DELETE` | `/api/kits/{slug}` | Delete a kit | + +### Kit Execution + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `POST` | `/api/kits/{slug}/execute` | Execute a kit (streaming) | +| `GET` | `/api/executions/{id}` | Get execution status | +| `GET` | `/api/executions/{id}/output` | Get execution output | + +### Resources & Steps + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `POST` | `/api/kits/{slug}/resources` | Add a resource | +| `PUT` | `/api/kits/{slug}/resources/{id}` | Update a resource | +| `DELETE` | `/api/kits/{slug}/resources/{id}` | Delete a resource | +| `POST` | `/api/kits/{slug}/steps` | Add a workflow step | +| `PUT` | `/api/kits/{slug}/steps/{id}` | Update a step | +| `DELETE` | `/api/kits/{slug}/steps/{id}` | Delete a step | + +### Documentation + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/docs` | List available documentation | +| `GET` | `/api/docs/{slug}` | Get documentation content | + +### Authentication + +| Method | Endpoint | Description | +|--------|----------|-------------| +| `GET` | `/api/auth/me` | Get current user | +| `GET` | `/api/auth/login` | Initiate OAuth login | +| `GET` | `/api/auth/callback` | OAuth callback | +| `POST` | `/api/auth/logout` | Logout | + +--- + +## Response Format + +All API responses follow a consistent format: + +### Success + +```json +{ + "ok": true, + "data": { ... } +} +``` + +### Error + +```json +{ + "ok": false, + "error": "Error message" +} +``` + +### Streaming + +Execution endpoints return Server-Sent Events (SSE): + +``` +event: step_start +data: {"step": 1, "total": 3} + +event: token +data: {"token": "Hello"} + +event: step_complete +data: {"step": 1, "output": "..."} + +event: complete +data: {"final_output": "..."} +``` + +--- + +## Authentication + +Most endpoints require authentication via session cookie: + +1. Login via `/api/auth/login` (initiates OAuth flow) +2. Session cookie is set after successful callback +3. Include cookie with subsequent requests + +Public endpoints (no auth required): + +- `GET /api/kits` — List public kits +- `GET /api/kits/{slug}` — Get public kit details +- `GET /api/docs/*` — Documentation +- `GET /api/openapi.json` — OpenAPI spec +- `GET /health` — Health check + +--- + +## Rate Limits + +Currently, no rate limits are enforced. Limits may be added in future versions for shared instances. + +--- + +## Learn More + +- **[Integration Guide](./README.md)** — Embedding Clerk in your app +- **[Integration Examples](./examples.md)** — Working code samples +- OpenAPI spec: `/api/openapi.json` diff --git a/docs/integration/examples.md b/docs/integration/examples.md new file mode 100644 index 0000000..67492b4 --- /dev/null +++ b/docs/integration/examples.md @@ -0,0 +1,128 @@ +# Integration Examples + +Working examples of Clerk integration patterns. + +--- + +## FastAPI Example + +The complete FastAPI integration example is available in the repository: + +``` +examples/fastapi-integration/ +├── main.py # FastAPI app with Clerk mounted +├── requirements.txt # Dependencies +└── README.md # Setup instructions +``` + +This example demonstrates: + +- Mounting Clerk at a subpath (`/clerk`) +- Custom authentication integration +- Calling Clerk's API from your routes +- Running reasoning kits programmatically + +### Quick Start + +```bash +cd examples/fastapi-integration +pip install -r requirements.txt +python main.py +``` + +Visit: + +- Your app: `http://localhost:8000/` +- Clerk UI: `http://localhost:8000/clerk` +- API docs: `http://localhost:8000/clerk/api/openapi.json` + +--- + +## Other Framework Examples + +### Django Integration (Coming Soon) + +A complete Django example showing: + +- Async view integration +- Database model synchronization +- Custom middleware for auth + +Planned for a future release. Track progress on GitHub. + +### Flask Integration (Coming Soon) + +A Flask example demonstrating: + +- Application factory pattern +- Blueprint integration +- Background task execution + +Planned for a future release. Track progress on GitHub. + +--- + +## Minimal Code Examples + +### Execute a Kit Programmatically + +```python +from openclerk.loader import load_reasoning_kit +from openclerk.graph import run_reasoning_kit + +# Load and run +kit = load_reasoning_kit("./my-kit") +result = run_reasoning_kit(kit) +print(result) +``` + +### List Kits from Database + +```python +import asyncio +from openclerk.db import get_async_session, ReasoningKitRepository + +async def list_kits(): + async with get_async_session() as session: + repo = ReasoningKitRepository(session) + kits = await repo.list_public() + return [k.slug for k in kits] + +kits = asyncio.run(list_kits()) +print(kits) +``` + +### Stream Kit Execution + +```python +from openclerk.loader import load_reasoning_kit +from openclerk.graph import stream_reasoning_kit + +async def stream_kit(): + kit = load_reasoning_kit("./my-kit") + async for event in stream_reasoning_kit(kit): + print(event) + +import asyncio +asyncio.run(stream_kit()) +``` + +--- + +## Next Steps + +- **[Integration Guide](./README.md)** — Detailed embedding guide +- **[API Reference](./api-reference.md)** — Complete API documentation +- Clone the repository and explore `examples/fastapi-integration/` + +--- + +## Contributing Examples + +Have an integration example to share? We'd love to add it! + +1. Create a new directory under `examples/` +2. Include a `README.md` with setup instructions +3. Submit a pull request + +See [Contributing Guide](../contributing/README.md) for details. diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md new file mode 100644 index 0000000..2b375d0 --- /dev/null +++ b/docs/user-guide/README.md @@ -0,0 +1,102 @@ +# User Guide + +Welcome to Clerk! This guide will help you get started with the Clerk framework for multi-step LLM reasoning workflows. + +## Getting Started + +### Installation + +Install Clerk using pip: + +```bash +pip install openclerk +``` + +Or using UV (recommended): + +```bash +uv add openclerk +``` + +### Verify Installation + +Check that Clerk is installed correctly: + +```bash +clerk --version +``` + +### Your First Workflow + +Let's run a simple reasoning kit to see Clerk in action: + +```bash +# List available kits +clerk list + +# Run a kit +clerk run example-kit +``` + +That's it! You've just executed your first multi-step LLM reasoning workflow. + +--- + +## Quick Start Example + +Here's a complete 5-line example: + +```bash +# 1. Install Clerk +pip install openclerk + +# 2. Create a new kit +clerk kit create my-first-kit --description "My first reasoning workflow" + +# 3. Add a resource +clerk kit add-resource my-first-kit --file data.txt + +# 4. Add a workflow step +clerk kit add-step my-first-kit --prompt "Analyze the data and summarize key findings" + +# 5. Run the kit +clerk run my-first-kit +``` + +--- + +## Next Steps + +Now that you've run your first workflow, explore these resources: + +- **[Core Concepts](concepts.md)** — Learn about Reasoning Kits, Resources, Instructions, and Workflows +- **[FAQ](faq.md)** — Find answers to common questions +- **[Reasoning Kits](../reasoning_kits.md)** — Deep dive into kit structure and creation + +--- + +## Common Commands + +| Command | Description | +| ------------------------------ | ----------------------------- | +| `clerk list` | List available reasoning kits | +| `clerk run ` | Run a reasoning kit | +| `clerk info ` | Show information about a kit | +| `clerk kit create ` | Create a new reasoning kit | +| `clerk kit add-resource ` | Add a resource to a kit | +| `clerk kit add-step ` | Add a workflow step to a kit | +| `clerk web` | Start the web UI server | + +--- + +## Getting Help + +If you run into issues: + +1. Check the [FAQ](faq.md) for common problems +2. Review the [Core Concepts](concepts.md) documentation +3. Visit our [GitHub Issues](https://github.com/your-org/clerk/issues) for community support + +--- + +Happy reasoning! diff --git a/docs/user-guide/concepts.md b/docs/user-guide/concepts.md new file mode 100644 index 0000000..443eb5b --- /dev/null +++ b/docs/user-guide/concepts.md @@ -0,0 +1,124 @@ +# Core Concepts + +Understanding these key concepts will help you build effective reasoning workflows with Clerk. + +--- + +## Reasoning Kits + +A **Reasoning Kit** is a reusable, multi-step LLM workflow. Think of it as a recipe that defines: + +- What data (resources) the workflow needs +- What steps (instructions) to perform +- How outputs from one step flow into the next + +Kits are stored as directories containing resource files and instruction files. This file-based approach makes them easy to version control and share. + +### Example Kit Structure + +``` +my-kit/ +├── resource_1.txt # Input data +├── resource_2.csv # Additional data +├── instruction_1.txt # Step 1: Analyze +└── instruction_2.txt # Step 2: Summarize +``` + +--- + +## Resources + +**Resources** are the data inputs for your workflow. They can be: + +- Text files (`.txt`, `.md`) +- Data files (`.csv`, `.json`) +- Documents (`.pdf` — text extracted automatically) +- Dynamic inputs (prompted at runtime) + +Resources are referenced in instructions using placeholders like `{resource_1}`, `{resource_2}`, etc. + +### Creating Resources + +```bash +# Add from a file +clerk kit add-resource my-kit --file ./data/report.txt + +# Add inline content +clerk kit add-resource my-kit --content "Sample data here" --filename sample.txt +``` + +--- + +## Instructions + +**Instructions** define what the LLM should do at each step. They're plain text files containing prompts that can reference: + +- Resources: `{resource_1}`, `{resource_2}` +- Previous step outputs: `{workflow_1}`, `{workflow_2}` + +### Example Instruction + +``` +Analyze the following data and identify three key trends: + +{resource_1} + +Provide your analysis as bullet points. +``` + +### Creating Instructions + +```bash +# Add from a file +clerk kit add-step my-kit --file ./prompts/analyze.txt + +# Add inline prompt +clerk kit add-step my-kit --prompt "Summarize the key findings from: {workflow_1}" +``` + +--- + +## Workflows + +A **Workflow** is the execution flow of instructions. Steps run sequentially, with each step's output available to subsequent steps. + +### Workflow Example + +| Step | Instruction | Input | Output | +|------|-------------|-------|--------| +| 1 | Read and analyze data | `{resource_1}` | `{workflow_1}` | +| 2 | Summarize findings | `{workflow_1}` | `{workflow_2}` | +| 3 | Generate recommendations | `{workflow_2}` | Final output | + +### Execution Flow + +1. Clerk loads all resources +2. Step 1 executes with its instruction (resources replaced with content) +3. Step 1's output is stored as `{workflow_1}` +4. Step 2 executes, with `{workflow_1}` replaced by actual output +5. Process continues through all steps +6. Final output is displayed + +--- + +## Evaluations + +**Evaluations** allow you to review and refine workflow execution: + +- Step-by-step review of LLM outputs +- Iterative refinement of results +- Anonymous mode for privacy (stores only character counts) + +Enable evaluation mode when running: + +```bash +clerk run my-kit --evaluate +``` + +--- + +## Learn More + +- **[Reasoning Kits](../reasoning_kits.md)** — Detailed kit structure and advanced features +- **[User Guide README](./README.md)** — Quick start and installation +- **[FAQ](./faq.md)** — Frequently asked questions diff --git a/docs/user-guide/faq.md b/docs/user-guide/faq.md new file mode 100644 index 0000000..444c828 --- /dev/null +++ b/docs/user-guide/faq.md @@ -0,0 +1,174 @@ +# FAQ + +Frequently asked questions about Clerk. + +--- + +## Installation Issues + +### Q: Installation fails with "No module named 'clerk'" + +**A:** Make sure you're installing the correct package: + +```bash +# Correct +pip install openclerk + +# Incorrect (different package) +pip install clerk +``` + +Also verify your Python version (3.13+ required): + +```bash +python --version +``` + +### Q: UV installation fails + +**A:** Ensure UV is installed first: + +```bash +curl -LsSf https://astral.sh/uv/install.sh | sh +``` + +Then try: + +```bash +uv tool install openclerk +``` + +--- + +## Kit Format Questions + +### Q: What file types are supported for resources? + +**A:** Clerk supports: + +- **Text files:** `.txt`, `.md`, `.py`, `.js`, etc. +- **Data files:** `.csv`, `.json`, `.yaml`, `.yml` +- **Documents:** `.pdf` (text extracted automatically) + +All files are converted to text for processing by the LLM. + +### Q: Can I have more than 9 resources or steps? + +**A:** Yes! Clerk supports any number of resources and workflow steps. They're numbered sequentially: `resource_1`, `resource_2`, ..., `resource_99`, etc. + +### Q: How do I reference resources in instructions? + +**A:** Use the placeholder syntax with curly braces: + +``` +{resource_1} # First resource +{resource_2} # Second resource +{workflow_1} # Output from step 1 +{workflow_2} # Output from step 2 +``` + +--- + +## LLM Requirements + +### Q: What LLM provider does Clerk use? + +**A:** Clerk uses LangChain and supports multiple providers: + +- OpenAI (default) +- Anthropic Claude +- Local models via Ollama +- Other LangChain-compatible providers + +### Q: How do I configure my API key? + +**A:** Set your API key as an environment variable: + +```bash +export OPENAI_API_KEY="sk-..." +``` + +Or create a `.env` file in your project root: + +``` +OPENAI_API_KEY=sk-... +``` + +### Q: Can I use a local LLM? + +**A:** Yes! Configure Clerk to use Ollama or other local providers by setting the appropriate environment variables. See the [Integration Guide](../integration/README.md) for details. + +--- + +## Running Workflows + +### Q: How do I pass dynamic data at runtime? + +**A:** Mark resources as dynamic when creating them. Clerk will prompt for file paths when running: + +```bash +clerk run my-kit +# Clerk prompts: "Enter file path for resource_3 (data.txt):" +``` + +### Q: Can I run kits from the database? + +**A:** Yes! If you've configured a database: + +```bash +# List database kits +clerk list + +# Run a database kit +clerk run kit-name + +# Run a local kit instead +clerk run my-kit --local +``` + +### Q: How do I debug a failing workflow? + +**A:** Use the evaluation mode to see step-by-step output: + +```bash +clerk run my-kit --evaluate +``` + +This lets you review each step's output before continuing. + +--- + +## Database & Sync + +### Q: Do I need a database to use Clerk? + +**A:** No! Clerk works perfectly with local file-based kits. The database is optional and enables: + +- Sharing kits across teams +- Version control for kits +- Web UI access + +### Q: How do I sync kits between local and database? + +**A:** Use the sync commands: + +```bash +# Push local kit to database +clerk sync push my-kit -m "Initial version" + +# Pull kit from database to local +clerk sync pull my-kit + +# Compare local and database +clerk sync list +``` + +--- + +## Getting More Help + +Can't find your question? Check: + +- **[Core Concepts](concepts.md)** — Detailed concept explanations +- **[GitHub Issues](https://github.com/your-org/clerk/issues)** — Community support +- **[Integration Guide](../integration/README.md)** — Embedding and API docs diff --git a/docs_for_dev/ARCHITECTURE.md b/docs_for_dev/ARCHITECTURE.md new file mode 100644 index 0000000..6d7a6a1 --- /dev/null +++ b/docs_for_dev/ARCHITECTURE.md @@ -0,0 +1,924 @@ +# CLERK/OpenClerk Dual-Purpose Architecture Plan + +> **Status:** Draft +> **Last Updated:** March 23, 2026 +> **Goal:** Transform the CLERK repository into both a PyPI-distributable Python package and a unified website (landing page + documentation + live application instance). + +--- + +## Table of Contents + +1. [Executive Summary](#executive-summary) +2. [Current State Analysis](#current-state-analysis) +3. [Target Architecture](#target-architecture) +4. [Repository Structure](#repository-structure) +5. [Python Package Design](#python-package-design) +6. [Website Architecture](#website-architecture) +7. [Deployment Strategy](#deployment-strategy) +8. [Implementation Phases](#implementation-phases) +9. [Technical Decisions](#technical-decisions) +10. [Migration Path](#migration-path) +11. [Open Questions](#open-questions) + +--- + +## Executive Summary + +This document outlines the plan to restructure the CLERK repository to serve two primary purposes: + +1. **Python Package Distribution**: A pip-installable package (`openclerk`) available on PyPI +2. **Unified Web Presence**: A website at `openclerk.ch` that combines: + - Marketing/landing pages + - Comprehensive documentation + - Live CLERK application instance with Supabase integration + +### Key Benefits + +- **Single source of truth**: Code and documentation live in one repository +- **Developer experience**: Users can install via pip OR use the web interface +- **Community growth**: Lower barrier to entry with multiple access points +- **SaaS potential**: Hosted version generates value while open-source package builds community + +--- + +## Current State Analysis + +### Repository Structure (Current) + +``` +clerk/ # Repository root +├── src/clerk/ # Python package source +│ ├── __init__.py +│ ├── cli.py # CLI entry point +│ ├── graph.py # LangGraph workflows +│ ├── loader.py # Kit loading logic +│ ├── models.py # Pydantic models +│ ├── web/ # FastAPI web interface +│ │ ├── app.py +│ │ └── routes/api.py +│ └── db/ # Database layer +├── frontend/ # React SPA (Vite + React 19) +│ ├── src/ +│ ├── package.json +│ └── dist/ # Build output +├── docs/ # Markdown documentation +│ ├── cli/ +│ ├── ui/ +│ └── *.md +├── reasoning_kits/ # Example kits +├── pyproject.toml # Package config (hatchling) +└── README.md +``` + +### Current Capabilities + +| Component | Status | Notes | +|-----------|--------|-------| +| CLI | ✅ Working | `clerk list`, `clerk run`, `clerk web` | +| Web UI | ✅ Working | FastAPI + React SPA served from `/` | +| Database | ✅ Working | Supabase (PostgreSQL) + SQLAlchemy | +| Auth | ✅ Working | Supabase Auth via session cookies | +| MCP | 🔄 Partial | Client implemented, server WIP | +| Documentation | ✅ Basic | Markdown files in `/docs` | + +### Current Limitations + +1. **Package naming**: `clerk` name likely unavailable on PyPI +2. **Bundled frontend**: Web app expects local `frontend/dist/` directory +3. **No separation**: Can't deploy web UI separately from Python package +4. **Documentation**: Static markdown not integrated with web UI +5. **Distribution**: No automated PyPI publishing + +--- + +## Target Architecture + +### High-Level Overview + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ openclerk.ch │ +│ (Next.js on Vercel) │ +│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │ +│ │ Landing │ │Documentation │ │ CLERK Web App │ │ +│ │ Pages │ │ (MDX) │ │ (Embedded SPA) │ │ +│ │ │ │ │ │ │ │ +│ │ - Features │ │ - Guides │ │ - Kit Browser │ │ +│ │ - Pricing │ │ - API Ref │ │ - Kit Editor │ │ +│ │ - About │ │ - Examples │ │ - Execute Flows │ │ +│ └──────────────┘ └──────────────┘ └──────────────────────┘ │ +└─────────────────────────────────────────────────────────────────┘ + │ + ┌────────────┴────────────┐ + │ │ + ┌─────▼──────┐ ┌──────▼──────┐ + │ Supabase │ │ CLERK API │ + │ (Auth/DB) │ │ (Railway) │ + └────────────┘ └─────────────┘ + │ + ┌──────────┴──────────┐ + │ │ + ┌─────▼─────┐ ┌────▼────┐ + │ PyPI │ │ Docker │ + │ Package │ │ Hub │ + └───────────┘ └─────────┘ +``` + +### Dual Access Model + +**As a Python Package:** +```bash +pip install openclerk +clerk list # List kits +clerk run my-kit # Execute locally +clerk web --local # Self-hosted web UI +``` + +**As a Web Application:** +``` +https://openclerk.ch +├── / → Landing page +├── /features → Product features +├── /docs → Documentation +├── /app → Live CLERK instance (requires login) +└── /pricing → SaaS pricing (future) +``` + +--- + +## Repository Structure + +### Proposed Monorepo Layout + +``` +openclerk/ # Repository root (renamed) +│ +├── .github/ +│ └── workflows/ +│ ├── release.yml # PyPI release automation +│ └── deploy.yml # Website deployment +│ +├── packages/ # Published packages +│ └── clerk/ # Python package (PyPI) +│ ├── pyproject.toml +│ ├── README.md +│ ├── LICENSE +│ ├── src/ +│ │ └── openclerk/ # Renamed from 'clerk' +│ │ ├── __init__.py +│ │ ├── cli.py +│ │ ├── graph.py +│ │ ├── loader.py +│ │ ├── models.py +│ │ ├── web/ # API-only (no bundled SPA) +│ │ │ ├── app.py +│ │ │ └── routes/ +│ │ └── db/ +│ └── tests/ +│ +├── apps/ # Deployable applications +│ └── website/ # Next.js website +│ ├── package.json +│ ├── next.config.js +│ ├── tsconfig.json +│ ├── tailwind.config.ts +│ ├── src/ +│ │ ├── app/ +│ │ │ ├── (marketing)/ +│ │ │ │ ├── page.tsx # Homepage +│ │ │ │ ├── features/ +│ │ │ │ ├── pricing/ +│ │ │ │ └── about/ +│ │ │ ├── docs/ +│ │ │ │ ├── [[...slug]]/ +│ │ │ │ │ └── page.tsx # Docs catch-all +│ │ │ │ └── layout.tsx +│ │ │ ├── app/ # CLERK web UI +│ │ │ │ ├── page.tsx +│ │ │ │ ├── dashboard/ +│ │ │ │ ├── kits/ +│ │ │ │ └── settings/ +│ │ │ ├── api/ # Next.js API routes +│ │ │ │ ├── auth/ +│ │ │ │ └── proxy/ +│ │ │ └── layout.tsx +│ │ ├── components/ +│ │ │ ├── ui/ # shadcn/ui +│ │ │ ├── marketing/ # Landing sections +│ │ │ └── docs/ # Doc components +│ │ ├── lib/ +│ │ │ ├── supabase.ts +│ │ │ └── utils.ts +│ │ └── styles/ +│ │ └── globals.css +│ ├── content/ # MDX documentation source +│ │ ├── getting-started.mdx +│ │ ├── reasoning-kits.mdx +│ │ ├── cli-reference.mdx +│ │ ├── api-reference/ +│ │ └── examples/ +│ └── public/ +│ ├── images/ +│ └── fonts/ +│ +├── docs/ # Architecture docs (this file, etc.) +│ ├── ARCHITECTURE.md # This document +│ ├── DECISIONS.md # ADRs (Architecture Decision Records) +│ └── DEPLOYMENT.md # Deployment runbooks +│ +├── reasoning_kits/ # Example/community kits +│ ├── demo/ +│ └── README.md +│ +├── docker/ +│ ├── Dockerfile.package # For package builds +│ └── Dockerfile.website # For website deployment +│ +├── scripts/ +│ ├── bootstrap.sh # Setup script +│ └── release.sh # Manual release helper +│ +├── pyproject.toml # Root workspace config (optional) +├── package.json # Root package.json (optional) +├── README.md # Root readme +├── LICENSE # MIT License +└── CONTRIBUTING.md # Contribution guidelines +``` + +--- + +## Python Package Design + +### Package Configuration + +**File:** `packages/clerk/pyproject.toml` + +```toml +[project] +name = "openclerk" +version = "0.1.0" +description = "Community Library of Executable Reasoning Kits" +readme = "README.md" +requires-python = ">=3.13" +license = "MIT" +authors = [ + {name = "Your Name", email = "you@example.com"} +] +keywords = ["llm", "ai", "workflow", "reasoning", "langchain", "langgraph"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.13", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + # LLM Framework + "langchain>=1.2.4", + "langchain-openai>=1.1.7", + "langgraph>=1.0.6", + # Database + "sqlalchemy[asyncio]>=2.0.36", + "alembic>=1.14.0", + "asyncpg>=0.30.0", + "supabase>=2.11.0", + # Web UI (API only) + "fastapi>=0.115.0", + "uvicorn[standard]>=0.32.0", + "python-multipart>=0.0.12", + "itsdangerous>=2.2.0", + "sse-starlette>=2.1.0", + "pgvector>=0.3.6", + "langchain-postgres>=0.0.17", + # Utilities + "python-dotenv>=1.2.1", + "pypdf>=5.1.0", + "openpyxl>=3.1.5", + "httpx>=0.27.0", + "beautifulsoup4>=4.12.0", + # LLM Providers + "langchain-anthropic>=1.3.5", + "langchain-mistralai>=1.1.2", + "langchain-google-genai>=4.2.1", +] + +[project.optional-dependencies] +dev = [ + "pytest>=8.0.0", + "pytest-asyncio>=0.23.0", + "ruff>=0.6.0", + "mypy>=1.10.0", +] +mcp = [ + "mcp>=1.26.0", +] + +[project.scripts] +clerk = "openclerk.cli:main" +openclerk = "openclerk.cli:main" + +[project.urls] +Homepage = "https://openclerk.ch" +Documentation = "https://openclerk.ch/docs" +Repository = "https://github.com/yourorg/openclerk" +Issues = "https://github.com/yourorg/openclerk/issues" +Changelog = "https://openclerk.ch/docs/changelog" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src/openclerk"] + +# Exclude SPA build from wheel (served separately) +[tool.hatch.build.targets.wheel.exclude] +paths = [ + "src/openclerk/web/static/spa/", + "**/tests/", + "**/test_*.py", +] + +[tool.uv] +package = true + +[tool.ruff] +line-length = 100 +target-version = "py313" + +[tool.mypy] +python_version = "3.13" +warn_return_any = true +warn_unused_configs = true +``` + +### Namespace Change + +The package namespace changes from `clerk` to `openclerk`: + +```python +# Before (current) +from clerk.loader import load_reasoning_kit +from clerk.graph import run_reasoning_kit + +# After (target) +from openclerk.loader import load_reasoning_kit +from openclerk.graph import run_reasoning_kit +``` + +### Web Module Changes + +The web module becomes API-only. It no longer serves the React SPA: + +```python +# packages/clerk/src/openclerk/web/app.py + +from fastapi import FastAPI + +# BEFORE: Serves SPA from frontend/dist/ +SPA_DIR = Path(__file__).parent.parent.parent.parent / "frontend" / "dist" +app.mount("/assets", StaticFiles(directory=SPA_DIR / "assets")) + +# AFTER: API only +# SPA is served by the website app (Next.js) +# API endpoints only + +app = FastAPI( + title="OpenClerk API", + description="API for Community Library of Executable Reasoning Kits", + version="0.1.0", + docs_url="/docs" if os.getenv("ENV") == "development" else None, +) + +# Only API routes - no static file serving +app.include_router(api_router, prefix="/api/v1") +``` + +### CLI Commands + +The CLI remains largely unchanged but gains environment detection: + +```bash +# Local filesystem mode (default) +clerk list --local +clerk run my-kit --local + +# Database mode (connects to Supabase) +clerk list +clerk run my-kit + +# Self-hosted web UI (API only) +clerk web --port 8000 + +# With local database (for self-hosting) +clerk web --local-db +``` + +--- + +## Website Architecture + +### Technology Stack + +| Layer | Technology | Rationale | +|-------|------------|-----------| +| Framework | Next.js 14+ (App Router) | SEO, SSR, static generation | +| Language | TypeScript | Type safety | +| Styling | Tailwind CSS | Utility-first, consistent design | +| UI Components | shadcn/ui | Accessible, customizable | +| Content | MDX | Markdown + React components | +| Auth | Supabase Auth | Already used in backend | +| Search | Algolia / Pagefind | Doc search (future) | +| Analytics | Vercel / Plausible | Privacy-friendly | + +### Route Structure + +``` +openclerk.ch/ +│ +├── / (GET) # Landing page +│ └── Features, CTA, testimonials +│ +├── /features (GET) # Detailed feature list +├── /pricing (GET) # Pricing tiers (future SaaS) +├── /about (GET) # About page, team +│ +├── /docs (GET) # Documentation homepage +├── /docs/getting-started # Installation & quickstart +├── /docs/reasoning-kits # Kit creation guide +├── /docs/cli-reference # CLI commands +├── /docs/api-reference # API endpoints +├── /docs/examples # Example kits +├── /docs/changelog # Version history +│ +├── /app (GET) # CLERK Web Application +│ ├── /app/dashboard # User dashboard +│ ├── /app/kits # Browse kits +│ ├── /app/kits/[id] # Kit detail/editor +│ ├── /app/kits/[id]/execute # Run kit +│ └── /app/settings # User settings +│ +├── /api (POST/GET) # Next.js API routes +│ ├── /api/auth/* # Supabase auth callbacks +│ └── /api/proxy/* # Proxy to CLERK backend +│ +└── /login, /signup (GET) # Auth pages (or use Supabase) +``` + +### Application Integration + +#### Option A: Embedded SPA (Quick Migration) + +Reuse the existing React frontend as an embedded application: + +```tsx +// apps/website/src/app/app/page.tsx +export default function ClerkAppPage() { + return ( +
+