Metadata-Version: 2.4
Name: tryvira-sdk
Version: 0.1.31
Summary: Typed Python client for the Vira authority boundary
Author: Vira
License-Expression: MIT
Project-URL: Repository, https://github.com/hrpering/tryvira
Project-URL: Documentation, https://github.com/hrpering/tryvira#readme
Keywords: ai-governance,observability,agent-runtime
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Vira Python SDK

MIT-licensed client library. The Vira service, application, and backend remain
proprietary and are governed separately.

Package name: `tryvira-sdk`.

## Install

```bash
python -m pip install tryvira-sdk==0.1.28
```

For a repository checkout use `python -m pip install ./sdks/python`. The client is a thin
HTTP client of Vira's authority boundary; it does not execute tools locally.

The SDK sends requests to Vira's API. It does not execute tools locally or bypass Vira's
scope, policy, evaluation, and release checks. Runtime requests fail closed; observation
telemetry can be configured with `failure_mode="open"` when appropriate.

## Pack lifecycle

Use a Pack when related Tasks, Points, Programs, Strategies, signals, and evaluation
material must move together. The lifecycle is always explicit:

```python
candidate = vira.import_pack({"manifest": manifest, "objects": objects}, idempotency_key="pack:import:1")
pack_id = candidate.body["pack"]["id"]
vira.install_pack(pack_id, {"brand_name": "Example Brand"})
evaluation = vira.evaluate_pack(pack_id, {"candidateExecutionRequired": True})
if evaluation.body.get("passed") is not True:
    raise RuntimeError("candidate evaluation did not pass")
vira.approve_pack(pack_id)
vira.release_pack(pack_id)
```

Import and install create or materialize a candidate; they do not authorize runtime
execution. Do not submit a client-made `passed`, `score`, or fake receipt. Release
requires the server-side evaluation receipt bound to the exact Pack digest. See the
[public Pack guide](https://github.com/hrpering/tryvira/blob/main/docs/packs.md) for
the manifest layout, JavaScript and MCP equivalents, upgrade preview, and troubleshooting.

```python
import os
from vira import ViraClient

with ViraClient(
    "http://127.0.0.1:4185",
    api_key=os.environ.get("VIRA_API_KEY"),
) as vira:
    connected = vira.connect_once(
        "my-agent", "custom-agent",
        {"organizationId": "org", "projectId": "project", "environmentId": "local"},
        "custom-python", "1",
        idempotency_key="connect-001",
    )
    system = connected.body["system"]
    connection = connected.body["connection"]
    vira.observe({
        "eventId": "evt-1", "eventType": "model.response",
        "aiSystemId": system["id"], "connectionId": connection["id"],
        "payload": {"message": "A model response was produced."},
    }, idempotency_key="evt-1")
    semantic = vira.resolve_semantic({"input": "answer a customer billing question"})
    print(semantic.body)
```

Runtime execution requires a released revision, a valid scope and an idempotency key;
semantic resolution is not authorization. See the public Vira documentation at
https://github.com/hrpering/tryvira for the shared JS/Python lifecycle.

Pack evaluation requires the ID of a persisted server-side `PASSED` evaluation bound
to the exact pack digest. The SDK does not accept client-supplied `passed` or `score`
as release evidence.

The package metadata is intentionally dependency-free.

