Metadata-Version: 2.4
Name: sconext-bambon-negotiator
Version: 0.0.1
Summary: A SingularConnector extension wrapping the BAMBON Bayesian Negotiator behind the INegotiationService interface.
Home-page: https://www.singularlogic.eu/
Author-email: Iason Sotiropoulos <isotiropoulos@singularlogic.eu>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.7.0
Requires-Dist: scontoolkit
Requires-Dist: dill>=0.3.8
Requires-Dist: bambon>=2.0.3b7
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
Dynamic: home-page

# sconext-bambon-negotiator

A SingularConnector negotiation service extension that wires the
[BAMBON Bayesian Negotiator](https://github.com/isotiropoulos/BayesianNegotiator)
into the `scontoolkit.interfaces.dsp.negotiator.INegotiationService`
interface.

The package implements `BambonNegotiator`, a thin adapter around the
`bambon.negotiator.Bambon` class. It delegates the actual contract
negotiation logic to BAMBON while taking care of:

* persisting / restoring the negotiator instance through `MongoStorage`
  using `dill`-based serialization,
* converting between the DSP 2025/1 `Offer` / `Agreement` /
  `MessageOffer` / `ContractOfferMessage` /
  `ContractRequestMessage` Pydantic models and the plain `dict`
  payloads BAMBON works with, and
* tracking provider / consumer roles via `NegotiationControl`.

## Installation

```
pip install sconext-bambon-negotiator
```

`bambon` is fetched directly from GitHub through the dependency entry
in `pyproject.toml`:

```
bambon @ git+https://github.com/isotiropoulos/BayesianNegotiator
```

## Usage

The class is registered as a `sconext` entry point so that the
SingularConnector core can discover it dynamically:

```toml
[project.entry-points."sconext"]
BambonNegotiator = "sconext_bambon_negotiator.negotiator:BambonNegotiator"
```

## Tests

Run the local test suite (which spins up two `BambonNegotiator`
instances and lets them negotiate against each other through an
in-memory MongoStorage stub):

```
pip install -e .[test]
pytest -q
```
