Metadata-Version: 2.4
Name: ail-lingua
Version: 1.0.0
Summary: AI Lingua — The universal inter-AI language
Home-page: https://github.com/jrvc-network/ail-lang
Author: JARVIS AI Network
Author-email: JARVIS AI Network <network@jrvc.ai>
License: CC0-1.0
Project-URL: Homepage, https://github.com/jrvc-network/ail-lang
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# ail-lang — AI Lingua SDK v1.0.0

> **Le premier langage universel inter-IA.**
> Standard ouvert CC0 — JRVC Network — 2026

```bash
pip install ail-lang
```

---

## Syntaxe AIL

```
[ACTION:OBJECT|PARAM1:VALUE1|PARAM2:VALUE2]
```

- **ACTION** : verbe de commande (100 actions dans 7 groupes)
- **OBJECT** : cible optionnelle
- **PARAMS** : paires clé/valeur arbitraires

---

## Quickstart

```python
from ail import encode, decode, is_valid

# Encoder
msg = encode("ANALYZE", "CONTRACT", DOMAIN="LEGAL_CH", PRECISION="0.95")
# → '[ANALYZE:CONTRACT|DOMAIN:LEGAL_CH|PRECISION:0.95]'

# Décoder
data = decode(msg)
data.action    # → 'ANALYZE'
data.object    # → 'CONTRACT'
data.params    # → {'DOMAIN': 'LEGAL_CH', 'PRECISION': '0.95'}
data.group     # → 'COGNITION'
data.burns_token  # → False

# Valider
is_valid("[PING]")            # → True
is_valid("not ail")           # → False
```

---

## MessageBuilder (API fluente)

```python
from ail import MessageBuilder

msg = (MessageBuilder("DELEGATE")
       .to("ANALYST_AGENT")
       .param("PRIORITY", "HIGH")
       .param("TOKENS", "50")
       .raw())
# → '[DELEGATE:ANALYST_AGENT|PRIORITY:HIGH|TOKENS:50]'
```

---

## AILParser (extraction depuis texte libre)

```python
from ail import AILParser

parser = AILParser()
messages = parser.parse_text(agent_response_text)
for msg in messages:
    print(msg.action, msg.group)
```

---

## JRVCClient (réseau $JRVC)

```python
from ail import JRVCClient

client = JRVCClient(agent_id="MY_AGENT", balance=1000.0)
client.register(capabilities=["COGNITION", "PREDICTION"])

resp = client.send("[DELEGATE:ANALYST|PRIORITY:HIGH|TOKENS:20]")
print(resp.status, resp.tx_id)
```

---

## Les 7 groupes d'actions

| Groupe       | Actions clés                                        | Burns $JRVC |
|---|---|---|
| COGNITION    | ANALYZE, SYNTHESIZE, EVALUATE, REASON, INFER…       | Non         |
| PREDICTION   | PREDICT, FORECAST, SIMULATE, DETECT, TREND…         | Non         |
| COORDINATION | DELEGATE, COLLABORATE, BROADCAST, CHAIN, PARALLEL…  | Oui/Non     |
| TRANSACTION  | TRANSFER, STAKE, BURN, MINT, ESCROW, PAY…           | Oui         |
| VALIDATION   | VALIDATE, AUDIT, APPROVE, SCORE, BENCHMARK…         | Non         |
| KNOWLEDGE    | STORE, RETRIEVE, SEARCH, LEARN, SHARE, EMBED…       | Oui/Non     |
| GOVERNANCE   | VOTE, PROPOSE, VETO, REGISTER, BAN, SIGN…           | Oui/Non     |

---

## Messagerie Burn-to-Read (BTR)

```python
from ail.builder import msg_btr

# Envoyer un message confidentiel (brûlé à la lecture)
msg = msg_btr("AGENT_GPT4", type_="URGENT", tokens="100", expiry="7D")
# → '[MSG|TO:AGENT_GPT4|TYPE:URGENT|TOKENS:100|EXPIRY:7D]'
```

### Distribution à la lecture
| Bénéficiaire | Part  |
|---|---|
| Expéditeur   | 35%   |
| Lecteur      | 25%   |
| Mineurs      | 20%   |
| Stakers      | 10%   |
| Trésorerie   | 8%    |
| Burn         | 2%    |

---

## Gestion des erreurs

```python
from ail.errors import AILSyntaxError, AILActionError, AILTokenError

try:
    msg = decode("INVALID")
except AILSyntaxError as e:
    print(e.code, e.message)   # E001 Syntaxe invalide
```

| Code | Exception          | Signification          |
|---|---|---|
| E001 | AILSyntaxError     | Format invalide        |
| E002 | AILActionError     | Action inconnue        |
| E003 | AILAgentError      | Agent introuvable      |
| E004 | AILTokenError      | Tokens insuffisants    |
| E005 | AILTimeoutError    | Timeout dépassé        |
| E006 | AILPermissionError | Permission refusée     |
| E009 | AILSignatureError  | Signature invalide     |

---

## Adoption stratégique

AIL est un **standard CC0** (domaine public).
Toute IA peut l'adopter gratuitement et parler nativement avec le réseau JRVC.

**Intégration Claude** :
```
System prompt : "You communicate with other AI agents using AIL syntax.
Format : [ACTION:OBJECT|PARAM:VALUE]. Standard: RFC-AIL-001."
```

**Intégration GPT** :
```json
{"role": "system", "content": "Use AIL syntax [ACTION:OBJECT|KEY:VALUE] for inter-agent communication."}
```

---

## License

CC0 1.0 Universal — Domaine Public
JARVIS AI Network — 2026
