diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 00000000..b8d0d748 --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,21 @@ +{ + "name": "JARVIS / Friday Voice Assistant", + "user": "ubuntu", + "install": "bash .cursor/install.sh", + "terminals": [ + { + "name": "backend", + "command": "source .venv/bin/activate && python server.py --port 8340", + "description": "FastAPI + WebSocket voice server (HTTPS on port 8340, uses cert.pem/key.pem)." + }, + { + "name": "frontend", + "command": "cd frontend && npm run dev -- --host", + "description": "Vite dev server for the Three.js orb UI on port 5173; proxies /api and /ws to the backend." + } + ], + "ports": [ + { "name": "frontend", "port": 5173 }, + { "name": "backend", "port": 8340 } + ] +} diff --git a/.cursor/install.sh b/.cursor/install.sh new file mode 100755 index 00000000..03c673ec --- /dev/null +++ b/.cursor/install.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# +# Idempotent install script for the JARVIS / Friday voice assistant. +# Prepares the Python backend, the Vite/Three.js frontend, Playwright's +# Chromium (used by the web-browsing / research actions), and local TLS +# certificates for the HTTPS backend + secure WebSocket. +# +# NOTE: The macOS AppleScript integrations (Calendar, Mail, Notes, Terminal) +# only run on macOS. On a Linux Cloud Agent the backend and frontend run and +# the full voice-loop transport works; those macOS features degrade gracefully. +set -euo pipefail + +# Always operate from the repository root (parent of the .cursor directory). +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$REPO_ROOT" + +# --------------------------------------------------------------------------- +# System package: the default image's python3 lacks the venv/ensurepip module. +# --------------------------------------------------------------------------- +if ! python3 -c "import ensurepip" >/dev/null 2>&1; then + sudo apt-get update -qq + sudo apt-get install -y -qq python3-venv +fi + +# --------------------------------------------------------------------------- +# Python backend dependencies (isolated in a virtualenv; .venv is gitignored). +# pytest / pytest-asyncio are required to run the repo's test suite. +# --------------------------------------------------------------------------- +if [ ! -x .venv/bin/python ]; then + python3 -m venv .venv +fi +# shellcheck disable=SC1091 +source .venv/bin/activate +python -m pip install --upgrade pip +pip install -r requirements.txt pytest pytest-asyncio + +# --------------------------------------------------------------------------- +# Playwright Chromium (+ system deps) for browser.py web browsing / research. +# --------------------------------------------------------------------------- +playwright install --with-deps chromium + +# --------------------------------------------------------------------------- +# Frontend dependencies. +# --------------------------------------------------------------------------- +( cd frontend && npm ci ) + +# --------------------------------------------------------------------------- +# Local TLS certificates for the HTTPS backend and secure WebSocket. +# Generated once; both files are gitignored. +# --------------------------------------------------------------------------- +if [ ! -f cert.pem ] || [ ! -f key.pem ]; then + openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem \ + -days 365 -nodes -subj '/CN=localhost' +fi + +echo "JARVIS environment ready." diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 00000000..f3586044 --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest diff --git a/.snapshots/config.json b/.snapshots/config.json new file mode 100644 index 00000000..7ab0f42a --- /dev/null +++ b/.snapshots/config.json @@ -0,0 +1,151 @@ +{ + "excluded_patterns": [ + ".git", + ".gitignore", + "gradle", + "gradlew", + "gradlew.*", + "node_modules", + ".snapshots", + ".idea", + ".vscode", + "*.log", + "*.tmp", + "target", + "dist", + "build", + ".DS_Store", + "*.bak", + "*.swp", + "*.swo", + "*.lock", + "*.iml", + "coverage", + "*.min.js", + "*.min.css", + "__pycache__", + ".marketing", + ".env", + ".env.*", + "*.jpg", + "*.jpeg", + "*.png", + "*.gif", + "*.bmp", + "*.tiff", + "*.ico", + "*.svg", + "*.webp", + "*.psd", + "*.ai", + "*.eps", + "*.indd", + "*.raw", + "*.cr2", + "*.nef", + "*.mp4", + "*.mov", + "*.avi", + "*.wmv", + "*.flv", + "*.mkv", + "*.webm", + "*.m4v", + "*.wfp", + "*.prproj", + "*.aep", + "*.psb", + "*.xcf", + "*.sketch", + "*.fig", + "*.xd", + "*.db", + "*.sqlite", + "*.sqlite3", + "*.mdb", + "*.accdb", + "*.frm", + "*.myd", + "*.myi", + "*.ibd", + "*.dbf", + "*.rdb", + "*.aof", + "*.pdb", + "*.sdb", + "*.s3db", + "*.ddb", + "*.db-shm", + "*.db-wal", + "*.sqlitedb", + "*.sql.gz", + "*.bak.sql", + "dump.sql", + "dump.rdb", + "*.vsix", + "*.jar", + "*.war", + "*.ear", + "*.zip", + "*.tar", + "*.tar.gz", + "*.tgz", + "*.rar", + "*.7z", + "*.exe", + "*.dll", + "*.so", + "*.dylib", + "*.app", + "*.dmg", + "*.iso", + "*.msi", + "*.deb", + "*.rpm", + "*.apk", + "*.aab", + "*.ipa", + "*.pkg", + "*.nupkg", + "*.snap", + "*.whl", + "*.gem", + "*.pyc", + "*.pyo", + "*.pyd", + "*.class", + "*.o", + "*.obj", + "*.lib", + "*.a", + "*.map", + ".npmrc" + ], + "default": { + "default_prompt": "Enter your prompt here", + "default_include_all_files": false, + "default_include_entire_project_structure": true + }, + "included_patterns": [ + "build.gradle", + "settings.gradle", + "gradle.properties", + "pom.xml", + "Makefile", + "CMakeLists.txt", + "package.json", + "requirements.txt", + "Pipfile", + "Gemfile", + "composer.json", + ".editorconfig", + ".eslintrc.json", + ".eslintrc.js", + ".prettierrc", + ".babelrc", + ".dockerignore", + ".gitattributes", + ".stylelintrc", + ".npmrc" + ] +}