Skip to main content

Typed async Python SDK for oneharness

Project description

oneharness-sdk

Async Python access to the oneharness engine, generated from and validated against the Rust-owned JSON Schema contracts. The distribution is oneharness-sdk, the import is oneharness_sdk, and every release depends on the exact same oneharness-cli version.

pip install oneharness-sdk
import asyncio

from oneharness_sdk import OneHarness


async def main() -> None:
    oneharness = OneHarness()
    report = await oneharness.run(
        {"prompt": "Summarize this repository", "harnesses": ["codex"]}
    )
    print(report["results"][0]["text"])


asyncio.run(main())

The complete client surface is run, run_stream, list, detect, history, history_list, and history_watch. run_stream and history_watch are async iterators. Every envelope is validated before it is yielded; closing or cancelling an iterator terminates its subprocess.

async for envelope in oneharness.run_stream(
    {"prompt": "Inspect this repository", "harnesses": ["codex"]}
):
    if envelope["type"] == "event" and envelope["event"]["name"] == "shell":
        break

async for envelope in oneharness.history_watch(
    {"labels": {"graph": "release"}, "after": last_history_id}
):
    print(envelope["record"]["history_id"])

Python input keys are snake case and strict: unknown fields and misspellings fail before the CLI starts. Output dictionaries preserve additive fields from newer compatible CLI versions. history and history_watch raise HistoryNotFoundError when a session, record, or cursor cannot be resolved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oneharness_sdk-0.4.1.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oneharness_sdk-0.4.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file oneharness_sdk-0.4.1.tar.gz.

File metadata

  • Download URL: oneharness_sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oneharness_sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 fe03f0fc518ab215df13fa05d6e14c5b282beafe319c771df21e77a2f9e3d186
MD5 4334699bd39d14136258d4227edeaf5f
BLAKE2b-256 d02da9152a2d75920536c1d819d6e6d652eb3b8730a55b58d090a7bc87259e81

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneharness_sdk-0.4.1.tar.gz:

Publisher: release.yml on nickderobertis/oneharness

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oneharness_sdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: oneharness_sdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oneharness_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 682633b1764b2de0d73c4eac56500525ac9c14182c497828fcc00a5936d30aa6
MD5 ae4ce6b150c6b50074e85549f3750e64
BLAKE2b-256 9519f06a3c557e29db077bfba279570e4cbee9a7ef0893367ca382c16e558a3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneharness_sdk-0.4.1-py3-none-any.whl:

Publisher: release.yml on nickderobertis/oneharness

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page