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.0.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.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oneharness_sdk-0.4.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3d5673c7328fa0d1382d2b7398e1ae3bfe2e4dee8d53737f0059152339960e22
MD5 e5ef2bbf9f68f125c8b99766b50c9a9c
BLAKE2b-256 b46c702f99d7b64321aa89b81b8fb625a1178df5bc80529d7ae37e1caaab33a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneharness_sdk-0.4.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: oneharness_sdk-0.4.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ea2104726be77be6e409fb06e2cb2a2ba0bbe7304202fb6540d549d8f93d769
MD5 05a59838eed137ac7cc2b50430cfbe47
BLAKE2b-256 a3defdf780e55d7f694b25aae6b29f30fe961a48eff9847734d71377e8041dcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for oneharness_sdk-0.4.0-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