From 438a54a79713fc6e6933cd1b5b84b0f71090140d Mon Sep 17 00:00:00 2001 From: SentienceDEV Date: Wed, 18 Feb 2026 18:05:55 -0800 Subject: [PATCH] rename sdk to predicatesystems/runtime --- .github/workflows/release.yml | 56 ++++++++++++++++++- .github/workflows/test.yml | 2 +- README.md | 8 ++- compat/predicate-sdk-shim/README.md | 10 ++++ .../predicate-sdk-shim/predicate_sdk_shim.py | 5 ++ compat/predicate-sdk-shim/pyproject.toml | 34 +++++++++++ examples/browser-use/README.md | 4 +- examples/browser-use/integration.py | 6 +- examples/lang-chain/README.md | 2 +- examples/lang-chain/langchain_tools_demo.py | 2 +- .../langgraph_self_correcting_graph.py | 2 +- .../sentience_self_correcting_graph.py | 2 +- .../pydantic_ai_self_correcting_click.py | 2 +- .../pydantic_ai_typed_extraction.py | 2 +- predicate/integrations/browser_use/plugin.py | 2 +- predicate/integrations/pydanticai/__init__.py | 2 +- pyproject.toml | 2 +- 17 files changed, 125 insertions(+), 18 deletions(-) create mode 100644 compat/predicate-sdk-shim/README.md create mode 100644 compat/predicate-sdk-shim/predicate_sdk_shim.py create mode 100644 compat/predicate-sdk-shim/pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9967e04..9a88bfa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -283,13 +283,65 @@ jobs: tag_name: v${{ steps.version.outputs.version }} name: Release v${{ steps.version.outputs.version }} body: | - Release v${{ steps.version.outputs.version }} of predicate-sdk + Release v${{ steps.version.outputs.version }} of predicate-runtime ## Installation ```bash - pip install predicate-sdk==${{ steps.version.outputs.version }} + pip install predicate-runtime==${{ steps.version.outputs.version }} ``` draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-compat-shim: + runs-on: ubuntu-latest + needs: build-and-publish + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Extract version from tag or input + id: version + run: | + if [ "${{ github.event_name }}" == "release" ]; then + VERSION=${GITHUB_REF#refs/tags/v} + VERSION=${VERSION#refs/tags/} + else + VERSION="${{ github.event.inputs.version }}" + fi + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Version: $VERSION" + + - name: Sync shim version and runtime dependency + run: | + VERSION="${{ steps.version.outputs.version }}" + SHIM_PYPROJECT="compat/predicate-sdk-shim/pyproject.toml" + sed -i "s/^version = \".*\"/version = \"$VERSION\"/" "$SHIM_PYPROJECT" + sed -i "s/^ \"predicate-runtime==.*\",/ \"predicate-runtime==$VERSION\",/" "$SHIM_PYPROJECT" + + - name: Build compatibility shim package + run: | + python -m build compat/predicate-sdk-shim -o dist-compat + + - name: Check compatibility shim package + run: | + twine check dist-compat/* + + - name: Publish compatibility shim to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + twine upload dist-compat/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d15829..5578292 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: shell: bash run: | pip cache purge || true - pip uninstall -y predicate-sdk predicatelabs || true + pip uninstall -y predicate-runtime predicate-sdk predicatelabs || true # Aggressively clean any bytecode cache (cross-platform Python approach) python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]" || true python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]" || true diff --git a/README.md b/README.md index a8f9e9b..89d68fa 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,16 @@ The core loop is: ## Install ```bash -pip install predicate-sdk +pip install predicate-runtime playwright install chromium ``` +Legacy install compatibility remains available through the shim package: + +```bash +pip install predicate-sdk +``` + If you’re developing from source (this repo), install the local checkout instead: ```bash diff --git a/compat/predicate-sdk-shim/README.md b/compat/predicate-sdk-shim/README.md new file mode 100644 index 0000000..0c2e430 --- /dev/null +++ b/compat/predicate-sdk-shim/README.md @@ -0,0 +1,10 @@ +# predicate-sdk compatibility shim + +This package exists to preserve install compatibility for users who still run: + +```bash +pip install predicate-sdk +``` + +It depends on `predicate-runtime` and does not provide a separate runtime surface. +Use canonical imports from `predicate` in your code. diff --git a/compat/predicate-sdk-shim/predicate_sdk_shim.py b/compat/predicate-sdk-shim/predicate_sdk_shim.py new file mode 100644 index 0000000..d94b8ed --- /dev/null +++ b/compat/predicate-sdk-shim/predicate_sdk_shim.py @@ -0,0 +1,5 @@ +"""Compatibility marker package for predicate-sdk -> predicate-runtime.""" + +__all__ = ["__shim_target__"] + +__shim_target__ = "predicate-runtime" diff --git a/compat/predicate-sdk-shim/pyproject.toml b/compat/predicate-sdk-shim/pyproject.toml new file mode 100644 index 0000000..82a6543 --- /dev/null +++ b/compat/predicate-sdk-shim/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "predicate-sdk" +version = "1.1.0" +description = "Compatibility shim for predicate-runtime" +readme = "README.md" +requires-python = ">=3.11" +license = {text = "MIT OR Apache-2.0"} +authors = [ + {name = "Sentience Team"} +] +dependencies = [ + "predicate-runtime==1.1.0", +] +keywords = ["predicate", "runtime", "compatibility", "shim"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", +] + +[project.urls] +Homepage = "https://github.com/Predicate-Labs/sdk-python" +Repository = "https://github.com/Predicate-Labs/sdk-python" +Issues = "https://github.com/Predicate-Labs/sdk-python/issues" + +[tool.setuptools] +py-modules = ["predicate_sdk_shim"] diff --git a/examples/browser-use/README.md b/examples/browser-use/README.md index 4e28b87..21c480f 100644 --- a/examples/browser-use/README.md +++ b/examples/browser-use/README.md @@ -16,13 +16,13 @@ This directory contains examples for integrating [Sentience](https://github.com/ Install both packages together using the optional dependency: ```bash -pip install "predicate-sdk[browser-use]" +pip install "predicate-runtime[browser-use]" ``` Or install separately: ```bash -pip install predicate-sdk browser-use +pip install predicate-runtime browser-use ``` ## Quick Start diff --git a/examples/browser-use/integration.py b/examples/browser-use/integration.py index 04cb440..2966655 100644 --- a/examples/browser-use/integration.py +++ b/examples/browser-use/integration.py @@ -6,10 +6,10 @@ using Sentience's snapshot-based grounding instead of coordinate estimation. Requirements: - pip install "predicate-sdk[browser-use]" python-dotenv + pip install "predicate-runtime[browser-use]" python-dotenv Or install separately: - pip install predicate-sdk browser-use python-dotenv + pip install predicate-runtime browser-use python-dotenv Usage: python examples/browser-use/integration.py @@ -240,7 +240,7 @@ async def example_with_sentience_context() -> None: print("Extension path:", get_extension_dir()) print() print("To run with a real browser:") - print(' 1. pip install "predicate-sdk[browser-use]" python-dotenv') + print(' 1. pip install "predicate-runtime[browser-use]" python-dotenv') print(" 2. Uncomment the browser-use imports and code sections") print(" 3. Run: python examples/browser-use/integration.py") diff --git a/examples/lang-chain/README.md b/examples/lang-chain/README.md index 789dcaf..dfed5d9 100644 --- a/examples/lang-chain/README.md +++ b/examples/lang-chain/README.md @@ -5,7 +5,7 @@ These examples show how to use Sentience as a **tool layer** inside LangChain an Install: ```bash -pip install predicate-sdk[langchain] +pip install predicate-runtime[langchain] ``` Examples: diff --git a/examples/lang-chain/langchain_tools_demo.py b/examples/lang-chain/langchain_tools_demo.py index 0c7f250..c9a5224 100644 --- a/examples/lang-chain/langchain_tools_demo.py +++ b/examples/lang-chain/langchain_tools_demo.py @@ -2,7 +2,7 @@ Example: Build Sentience LangChain tools (async-only). Install: - pip install predicate-sdk[langchain] + pip install predicate-runtime[langchain] Run: python examples/lang-chain/langchain_tools_demo.py diff --git a/examples/lang-chain/langgraph_self_correcting_graph.py b/examples/lang-chain/langgraph_self_correcting_graph.py index abda07f..4910b78 100644 --- a/examples/lang-chain/langgraph_self_correcting_graph.py +++ b/examples/lang-chain/langgraph_self_correcting_graph.py @@ -2,7 +2,7 @@ LangGraph reference example: Sentience observe → act → verify → branch (self-correcting). Install: - pip install predicate-sdk[langchain] + pip install predicate-runtime[langchain] Run: python examples/lang-chain/langgraph_self_correcting_graph.py diff --git a/examples/langgraph/sentience_self_correcting_graph.py b/examples/langgraph/sentience_self_correcting_graph.py index 8e94b52..45d18db 100644 --- a/examples/langgraph/sentience_self_correcting_graph.py +++ b/examples/langgraph/sentience_self_correcting_graph.py @@ -2,7 +2,7 @@ LangGraph reference example: Sentience observe → act → verify → branch (self-correcting). Install: - pip install predicate-sdk[langchain] + pip install predicate-runtime[langchain] Run: python examples/langgraph/sentience_self_correcting_graph.py diff --git a/examples/pydantic_ai/pydantic_ai_self_correcting_click.py b/examples/pydantic_ai/pydantic_ai_self_correcting_click.py index 195c7f4..9afada5 100644 --- a/examples/pydantic_ai/pydantic_ai_self_correcting_click.py +++ b/examples/pydantic_ai/pydantic_ai_self_correcting_click.py @@ -2,7 +2,7 @@ Example: PydanticAI + Sentience self-correcting action loop using URL guards. Run: - pip install predicate-sdk[pydanticai] + pip install predicate-runtime[pydanticai] python examples/pydantic_ai/pydantic_ai_self_correcting_click.py """ diff --git a/examples/pydantic_ai/pydantic_ai_typed_extraction.py b/examples/pydantic_ai/pydantic_ai_typed_extraction.py index 52ed84f..5ce4a77 100644 --- a/examples/pydantic_ai/pydantic_ai_typed_extraction.py +++ b/examples/pydantic_ai/pydantic_ai_typed_extraction.py @@ -2,7 +2,7 @@ Example: PydanticAI + Sentience typed extraction (Phase 1 integration). Run: - pip install predicate-sdk[pydanticai] + pip install predicate-runtime[pydanticai] python examples/pydantic_ai/pydantic_ai_typed_extraction.py """ diff --git a/predicate/integrations/browser_use/plugin.py b/predicate/integrations/browser_use/plugin.py index b2dad5a..810e6f2 100644 --- a/predicate/integrations/browser_use/plugin.py +++ b/predicate/integrations/browser_use/plugin.py @@ -361,7 +361,7 @@ def register_tools(self, tools: Any) -> None: raise ImportError("browser_use.ActionResult/BrowserSession not available") except Exception as e: # pragma: no cover raise ImportError( - "browser-use is required to register tools. Install with `predicate-sdk[browser-use]`." + "browser-use is required to register tools. Install with `predicate-runtime[browser-use]`." ) from e if tools is None: diff --git a/predicate/integrations/pydanticai/__init__.py b/predicate/integrations/pydanticai/__init__.py index 825e5a9..40f0786 100644 --- a/predicate/integrations/pydanticai/__init__.py +++ b/predicate/integrations/pydanticai/__init__.py @@ -4,7 +4,7 @@ This module does NOT import `pydantic_ai` at import time so the base SDK can be installed without the optional dependency. Users should install: - pip install predicate-sdk[pydanticai] + pip install predicate-runtime[pydanticai] and then use `register_sentience_tools(...)` with a PydanticAI `Agent`. """ diff --git a/pyproject.toml b/pyproject.toml index ca737d8..4ba3d28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "predicate-sdk" +name = "predicate-runtime" version = "1.1.0" description = "Python SDK for Sentience AI Agent Browser Automation" readme = "README.md"