Metadata-Version: 2.4
Name: cygnos-shared
Version: 0.1.0
Summary: Cygnos cross-distribution definitions — wire event schema, model rates, and content-risk rules shared by the server, the SDK and the capture proxy.
Author-email: Cygnos AI Private Limited <hello@cygnos.ai>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://cygnos.ai
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: schema
Requires-Dist: pydantic>=2; extra == "schema"
Dynamic: license-file

# cygnos-shared

The definitions that more than one Cygnos distribution must agree on.

| Module | Contents | Needs |
|---|---|---|
| `cygnos_shared.content_risk` | PII regexes, sensitive-keyword list, pure scan functions returning content-free dicts | stdlib only |
| `cygnos_shared.ai_event` | the wire event schema (`AIEvent`, `TokenUsage`, `CostEstimate`, `RiskFlag`, …) | `[schema]` |
| `cygnos_shared.pricing` | published per-model rates + the cache-aware cost estimator | `[schema]` |
| `cygnos_shared.content_flags` | the `RiskFlag` adapter over the rules, and the D84/D89 fail-open handler | `[schema]` |

## Why it exists

Three distributions ship separately and must classify, price and serialise identically:

- the backend server (runs from the repo),
- the Cygnos SDK — `pip install cygnos`,
- the capture proxy — `pip install cygnos-capture-proxy`.

Before PKG-1 the schema, the rates and the risk adapter lived under `backend/`, so the proxy
could only run from a repo clone. Copying them into the proxy would have produced second copies
of a wire contract, a price table and the codebase's one content-exfiltration guard. They moved
here instead — once — and every historical import path is a re-export shim.

## The dependency split is load-bearing

`cygnos-shared` declares **no base dependencies**. `content_risk` is stdlib-only, which is what
lets the SDK depend on this package while keeping its "OpenTelemetry + stdlib only" property.
Everything that needs pydantic sits behind the `schema` extra.

    pip install cygnos-shared            # content_risk only
    pip install "cygnos-shared[schema]"  # + ai_event, pricing, content_flags

Adding a base dependency here would silently push it into `pip install cygnos`.
