Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ brew install openadaptai/tap/openadapt

For browser workflows with zero CLI setup, install the 1-click Chrome extension: **[OpenAdapt Co-Pilot on the Chrome Web Store](https://chromewebstore.google.com/detail/openadapt-co-pilot/bcpliibliddclnibacbjbmbpgffkjefd)**.

### Wrap Any Python Agent or Tool in 2 Lines

Add pinned record checks, duplicate-submit protection on uncertain writes, same-screen verification, and SHA-256 or Ed25519 receipts to any Python function, Playwright helper, MCP tool, or agent with zero YAML files:

```python
import openadapt

safe_save = openadapt.wrap(
save_chart_note,
pinned={"patient_id": "PT-104"},
check=lambda out, *a, **kw: out.get("saved") is True,
)
safe_save(patient_id="PT-104", note="Follow-up scheduled")
print(safe_save.last_receipt["outcome"], safe_save.last_receipt["checked_how"]) # confirmed same_screen
```

### Try It in 30 Seconds

Run the local smoke test against a bundled demo server (no account or API key required), or trigger a deliberate drift to inspect a halted run and its signed receipt:
Expand Down
36 changes: 36 additions & 0 deletions openadapt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,32 @@ def __getattr__(name: str):
"Install with: pip install openadapt-kernel"
)

# Lightweight 2-line Python SDK wrapper (stdlib-only at import time)
if name in (
"wrap",
"WrapResult",
"WrapReceipt",
"WrapError",
"WrapBlockedError",
"WrapVerificationError",
"WrapLedger",
"WrapOutcome",
"verify_wrap_receipt",
):
from openadapt.wrap_sdk import ( # noqa: F401
WrapBlockedError,
WrapError,
WrapLedger,
WrapOutcome,
WrapReceipt,
WrapResult,
WrapVerificationError,
verify_wrap_receipt,
wrap,
)

return locals()[name]

# Demo library lives in openadapt-evals
if name == "DemoLibrary":
try:
Expand All @@ -137,6 +163,16 @@ def __getattr__(name: str):

__all__ = [
"__version__",
# 2-line Python SDK wrapper
"wrap",
"WrapResult",
"WrapReceipt",
"WrapError",
"WrapBlockedError",
"WrapVerificationError",
"WrapLedger",
"WrapOutcome",
"verify_wrap_receipt",
# From kernel (canonical runtime)
"CommitInterceptor",
"ObligationLedger",
Expand Down
Loading