halyn 0.2.2__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. halyn-0.3.0/PKG-INFO +288 -0
  2. halyn-0.3.0/README.md +252 -0
  3. {halyn-0.2.2 → halyn-0.3.0}/pyproject.toml +3 -2
  4. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/__init__.py +1 -1
  5. halyn-0.3.0/src/halyn/integrations/telegram.py +193 -0
  6. halyn-0.3.0/src/halyn/mcp_serve.py +378 -0
  7. halyn-0.3.0/src/halyn/py.typed +0 -0
  8. halyn-0.3.0/src/halyn.egg-info/PKG-INFO +288 -0
  9. {halyn-0.2.2 → halyn-0.3.0}/src/halyn.egg-info/SOURCES.txt +3 -0
  10. {halyn-0.2.2 → halyn-0.3.0}/src/halyn.egg-info/entry_points.txt +1 -0
  11. {halyn-0.2.2 → halyn-0.3.0}/tests/test_halyn.py +1 -1
  12. halyn-0.2.2/PKG-INFO +0 -247
  13. halyn-0.2.2/README.md +0 -211
  14. halyn-0.2.2/src/halyn.egg-info/PKG-INFO +0 -247
  15. {halyn-0.2.2 → halyn-0.3.0}/LICENSE +0 -0
  16. {halyn-0.2.2 → halyn-0.3.0}/setup.cfg +0 -0
  17. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/__main__.py +0 -0
  18. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/audit.py +0 -0
  19. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/auth.py +0 -0
  20. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/autonomy.py +0 -0
  21. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/cli.py +0 -0
  22. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/config.py +0 -0
  23. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/consent.py +0 -0
  24. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/control_plane.py +0 -0
  25. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/discovery.py +0 -0
  26. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/__init__.py +0 -0
  27. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/browser.py +0 -0
  28. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/dds.py +0 -0
  29. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/docker.py +0 -0
  30. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/http_auto.py +0 -0
  31. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/mqtt.py +0 -0
  32. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/opcua.py +0 -0
  33. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/ros2.py +0 -0
  34. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/serial.py +0 -0
  35. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/socket_raw.py +0 -0
  36. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/ssh.py +0 -0
  37. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/unitree.py +0 -0
  38. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/drivers/websocket.py +0 -0
  39. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/engine.py +0 -0
  40. {halyn-0.2.2/src/halyn/memory → halyn-0.3.0/src/halyn/integrations}/__init__.py +0 -0
  41. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/intent.py +0 -0
  42. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/llm.py +0 -0
  43. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/mcp.py +0 -0
  44. /halyn-0.2.2/src/halyn/py.typed → /halyn-0.3.0/src/halyn/memory/__init__.py +0 -0
  45. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/memory/store.py +0 -0
  46. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/nrp_bridge.py +0 -0
  47. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/sanitizer.py +0 -0
  48. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/server.py +0 -0
  49. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/types.py +0 -0
  50. {halyn-0.2.2 → halyn-0.3.0}/src/halyn/watchdog.py +0 -0
  51. {halyn-0.2.2 → halyn-0.3.0}/src/halyn.egg-info/dependency_links.txt +0 -0
  52. {halyn-0.2.2 → halyn-0.3.0}/src/halyn.egg-info/requires.txt +0 -0
  53. {halyn-0.2.2 → halyn-0.3.0}/src/halyn.egg-info/top_level.txt +0 -0
halyn-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,288 @@
1
+ Metadata-Version: 2.4
2
+ Name: halyn
3
+ Version: 0.3.0
4
+ Summary: Halyn — NRP control plane with domain-scoped authorization.
5
+ Author-email: Elmadani SALKA <contact@halyn.dev>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/ElmadaniS/halyn
8
+ Project-URL: Repository, https://github.com/ElmadaniS/halyn
9
+ Project-URL: Issues, https://github.com/ElmadaniS/halyn/issues
10
+ Keywords: ai,browser,robotics,iot,mcp,nrp,llm,infrastructure,devops
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: Topic :: System :: Systems Administration
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: nrprotocol>=0.1.0
20
+ Requires-Dist: aiohttp>=3.9
21
+ Provides-Extra: enterprise
22
+ Requires-Dist: grpcio>=1.60; extra == "enterprise"
23
+ Requires-Dist: psycopg2-binary; extra == "enterprise"
24
+ Requires-Dist: redis; extra == "enterprise"
25
+ Provides-Extra: robotics
26
+ Requires-Dist: rclpy; extra == "robotics"
27
+ Requires-Dist: unitree-sdk2py; extra == "robotics"
28
+ Provides-Extra: iot
29
+ Requires-Dist: paho-mqtt; extra == "iot"
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest; extra == "dev"
32
+ Requires-Dist: pytest-asyncio; extra == "dev"
33
+ Requires-Dist: mypy; extra == "dev"
34
+ Requires-Dist: ruff; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ <div align="center">
38
+
39
+ # Halyn
40
+
41
+ **The AI control plane. Connect any device to any LLM.**
42
+
43
+ [![PyPI](https://img.shields.io/pypi/v/halyn?style=flat-square&color=0a6e3f)](https://pypi.org/project/halyn/)
44
+ [![License](https://img.shields.io/badge/license-MIT-0a6e3f?style=flat-square)](LICENSE)
45
+ [![Python](https://img.shields.io/badge/python-3.10+-0a6e3f?style=flat-square)](https://pypi.org/project/halyn/)
46
+
47
+ 12 drivers · 5 autonomy levels · tamper-evident audit · shield rules
48
+
49
+ [Website](https://halyn.dev) · [Quickstart](#quickstart) · [Use Cases](#use-cases) · [Docs](docs/)
50
+
51
+ </div>
52
+
53
+ ---
54
+
55
+ ## The Problem
56
+
57
+ AI is moving into the physical world. Robots, drones, smart homes, factories, vehicles. But there's no universal way for an LLM to safely control hardware.
58
+
59
+ MCP connects LLMs to software APIs. **Halyn connects LLMs to everything else** — servers, sensors, robots, serial ports, browsers, Docker containers. With safety built in at the protocol level.
60
+
61
+ ## Quickstart
62
+
63
+ ```bash
64
+ pip install halyn
65
+ ```
66
+
67
+ **Monitor a server in 5 lines:**
68
+
69
+ ```python
70
+ from halyn import ControlPlane, SSHDriver
71
+
72
+ cp = ControlPlane()
73
+ cp.connect(SSHDriver("192.168.1.10", "admin"))
74
+ print(cp.observe()) # → {"cpu": 23.4, "mem": 67.2, "disk": 45.1, ...}
75
+ ```
76
+
77
+ **Control a Raspberry Pi GPIO:**
78
+
79
+ ```python
80
+ from halyn import ControlPlane, SSHDriver
81
+
82
+ cp = ControlPlane()
83
+ cp.connect(SSHDriver("raspberrypi.local", "pi"))
84
+
85
+ # Add a safety rule: never touch GPIO 4 (connected to emergency stop)
86
+ cp.shield("deny gpio write 4")
87
+
88
+ cp.act("gpio write 17 high") # ✓ turns on LED
89
+ cp.act("gpio write 4 low") # ✗ blocked by shield rule
90
+ ```
91
+
92
+ **Let Claude control your home lab:**
93
+
94
+ ```python
95
+ from halyn import ControlPlane, SSHDriver, Autonomy
96
+
97
+ cp = ControlPlane(autonomy=Autonomy.SUPERVISED) # AI proposes, human approves
98
+ cp.connect(SSHDriver("homelab.local", "admin"))
99
+
100
+ # Shield: read-only on production, full access on staging
101
+ cp.shield("deny * write /prod/*")
102
+ cp.shield("allow * * /staging/*")
103
+
104
+ # AI can now observe and propose actions
105
+ # Human gets a prompt before anything executes
106
+ ```
107
+
108
+ ## 12 Drivers
109
+
110
+ | Driver | What It Connects | Example |
111
+ |--------|-----------------|---------|
112
+ | `SSHDriver` | Any Linux/Mac server | Monitor servers, deploy code |
113
+ | `HTTPDriver` | REST APIs, webhooks | Control smart home APIs |
114
+ | `WebSocketDriver` | Real-time streams | Live sensor data |
115
+ | `SerialDriver` | Arduino, Raspberry Pi, PLCs | Read sensors, control actuators |
116
+ | `MQTTDriver` | IoT networks | Smart agriculture, building automation |
117
+ | `OPCUADriver` | Industrial machines (Industry 4.0) | CNC, SCADA, factory equipment |
118
+ | `ROS2Driver` | Robots (ROS ecosystem) | Robot arms, mobile robots, drones |
119
+ | `DDSDriver` | Real-time distributed systems | Autonomous vehicles, defense |
120
+ | `DockerDriver` | Containers and orchestration | Scale services, manage deployments |
121
+ | `BrowserDriver` | Web automation | Fill forms, scrape data, test UIs |
122
+ | `UnitreeDriver` | Unitree robots | Go2, B2, H1 quadrupeds and humanoids |
123
+ | `SocketDriver` | Raw TCP/UDP | Custom hardware, legacy systems |
124
+
125
+ ## 5 Autonomy Levels
126
+
127
+ | Level | Name | Who Decides | Use Case |
128
+ |-------|------|-------------|----------|
129
+ | 0 | **Manual** | Human does everything | Learning, debugging |
130
+ | 1 | **Advisory** | AI suggests, human executes | Critical systems |
131
+ | 2 | **Supervised** | AI executes, human approves first | Production ops |
132
+ | 3 | **Monitored** | AI executes freely, human can intervene | Routine tasks |
133
+ | 4 | **Autonomous** | AI decides within shield rules | Fully automated systems |
134
+
135
+ ## Shield Rules — Safety as Physics
136
+
137
+ Shield rules aren't guidelines. They're constraints enforced at the protocol level. Your AI physically cannot violate them, regardless of its instructions.
138
+
139
+ ```python
140
+ # Industrial safety
141
+ cp.shield("deny actuator write pressure > 150") # never exceed 150 PSI
142
+ cp.shield("deny motor write speed > 3000") # RPM limit
143
+ cp.shield("require human_approval for emergency_stop disable")
144
+
145
+ # Data safety
146
+ cp.shield("deny * read /etc/shadow")
147
+ cp.shield("deny * write /prod/database/*")
148
+ cp.shield("deny * delete *") # read-only mode
149
+
150
+ # Rate limiting
151
+ cp.shield("limit actions 10/minute")
152
+ ```
153
+
154
+ ## Audit Chain
155
+
156
+ Every action Halyn executes is recorded in a tamper-evident SHA-256 chain. Nothing can be altered or deleted.
157
+
158
+ ```python
159
+ # View the audit trail
160
+ for entry in cp.audit.chain():
161
+ print(f"{entry.timestamp} | {entry.action} | {entry.result} | {entry.hash[:12]}")
162
+
163
+ # 2026-03-17T01:30:00 | observe cpu | 23.4% | a3f8c9d1e2b4
164
+ # 2026-03-17T01:30:01 | act restart nginx| success | 7b2e4f6a8c0d
165
+ # 2026-03-17T01:30:02 | observe cpu | 12.1% | e5d7c9b1a3f8
166
+ ```
167
+
168
+ Perfect for compliance (SOC2, ISO 27001, GDPR audit trails).
169
+
170
+ ## Use Cases
171
+
172
+ ### 🏭 Smart Factory
173
+
174
+ Connect AI to your factory floor. OPC-UA driver reads machine data. Shield rules prevent dangerous operations. Audit chain provides compliance trail.
175
+
176
+ ```python
177
+ cp = ControlPlane(autonomy=Autonomy.MONITORED)
178
+ cp.connect(OPCUADriver("opc.tcp://plc-01:4840"))
179
+ cp.shield("deny * write temperature > 200")
180
+ cp.shield("deny * write pressure > 150")
181
+
182
+ # AI monitors machines, optimizes parameters within safe bounds
183
+ # Every adjustment is audited
184
+ ```
185
+
186
+ ### 🌱 Precision Agriculture
187
+
188
+ MQTT sensors across your field report soil moisture, temperature, weather. AI decides when to irrigate, which zones need attention.
189
+
190
+ ```python
191
+ cp = ControlPlane()
192
+ cp.connect(MQTTDriver("mqtt://field-gateway:1883"))
193
+ cp.shield("limit irrigation 3/day") # prevent overwatering
194
+ cp.shield("deny irrigation if wind > 30") # no sprinklers in wind
195
+
196
+ data = cp.observe() # reads all sensors
197
+ # AI analyzes and triggers irrigation for dry zones
198
+ ```
199
+
200
+ ### 🏥 Patient Monitoring
201
+
202
+ Serial connection to medical devices. AI watches vitals 24/7, alerts staff immediately when something changes. Shield rules ensure the AI can never modify device settings.
203
+
204
+ ```python
205
+ cp = ControlPlane(autonomy=Autonomy.ADVISORY) # AI advises only
206
+ cp.connect(SerialDriver("/dev/ttyUSB0", baudrate=9600))
207
+ cp.shield("deny * write *") # read-only — AI cannot control the device
208
+
209
+ vitals = cp.observe() # heart rate, SpO2, blood pressure
210
+ # AI detects anomaly → alerts nurse station
211
+ ```
212
+
213
+ ### 🤖 Robot Fleet
214
+
215
+ ROS2 driver connects to any robot in the ROS ecosystem. Shield rules define the workspace. Consent protocol ensures robots agree before coordinating.
216
+
217
+ ```python
218
+ cp = ControlPlane()
219
+ cp.connect(ROS2Driver("robot-arm-01"))
220
+ cp.connect(ROS2Driver("robot-arm-02"))
221
+
222
+ cp.shield("deny movement outside workspace_bounds")
223
+ cp.shield("deny force > 50N") # collaborative robot limits
224
+
225
+ # Consent: robots negotiate shared workspace access
226
+ cp.consent("robot-arm-01", "robot-arm-02", scope="shared_zone_A")
227
+ ```
228
+
229
+ ### 🏠 Smart Home
230
+
231
+ Connect every device in your home. Your AI assistant can control lights, thermostat, locks — but shield rules ensure it can never unlock doors at night or set the thermostat below 15°C.
232
+
233
+ ```python
234
+ cp = ControlPlane()
235
+ cp.connect(MQTTDriver("mqtt://home-hub:1883"))
236
+
237
+ cp.shield("deny lock unlock between 23:00-06:00")
238
+ cp.shield("deny thermostat write < 15")
239
+ cp.shield("deny * * camera") # AI has no camera access
240
+
241
+ cp.act("lights living_room dim 40%")
242
+ ```
243
+
244
+ ### 🎓 Education
245
+
246
+ Students learn AI-hardware interaction in 10 lines. Connect an Arduino, read a temperature sensor, make an LED blink based on AI decisions.
247
+
248
+ ```python
249
+ from halyn import ControlPlane, SerialDriver
250
+
251
+ cp = ControlPlane()
252
+ cp.connect(SerialDriver("/dev/ttyACM0"))
253
+
254
+ temp = cp.observe()["temperature"]
255
+ if temp > 30:
256
+ cp.act("led on") # too hot → warning LED
257
+ else:
258
+ cp.act("led off")
259
+ ```
260
+
261
+ ## Built on NRP
262
+
263
+ Halyn implements [NRP (Node Reach Protocol)](https://github.com/ElmadaniS/nrp) — 6 primitives that define how AI talks to hardware:
264
+
265
+ | Primitive | Purpose |
266
+ |-----------|---------|
267
+ | **Manifest** | "I am" — device declares its identity and capabilities |
268
+ | **Observe** | "I see" — read state without side effects |
269
+ | **Act** | "I do" — execute an action on the device |
270
+ | **Shield** | "I cannot" — enforceable constraints |
271
+ | **Audit** | "I did" — tamper-evident action log |
272
+ | **Consent** | "We agree" — mutual permission negotiation |
273
+
274
+ ## Contributing
275
+
276
+ See [CONTRIBUTING.md](CONTRIBUTING.md). We especially welcome new drivers and shield rule patterns.
277
+
278
+ ## License
279
+
280
+ MIT — use it anywhere, for anything.
281
+
282
+ ---
283
+
284
+ <div align="center">
285
+
286
+ **[halyn.dev](https://halyn.dev)** · **contact@halyn.dev** · © 2026 Elmadani SALKA
287
+
288
+ </div>
halyn-0.3.0/README.md ADDED
@@ -0,0 +1,252 @@
1
+ <div align="center">
2
+
3
+ # Halyn
4
+
5
+ **The AI control plane. Connect any device to any LLM.**
6
+
7
+ [![PyPI](https://img.shields.io/pypi/v/halyn?style=flat-square&color=0a6e3f)](https://pypi.org/project/halyn/)
8
+ [![License](https://img.shields.io/badge/license-MIT-0a6e3f?style=flat-square)](LICENSE)
9
+ [![Python](https://img.shields.io/badge/python-3.10+-0a6e3f?style=flat-square)](https://pypi.org/project/halyn/)
10
+
11
+ 12 drivers · 5 autonomy levels · tamper-evident audit · shield rules
12
+
13
+ [Website](https://halyn.dev) · [Quickstart](#quickstart) · [Use Cases](#use-cases) · [Docs](docs/)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## The Problem
20
+
21
+ AI is moving into the physical world. Robots, drones, smart homes, factories, vehicles. But there's no universal way for an LLM to safely control hardware.
22
+
23
+ MCP connects LLMs to software APIs. **Halyn connects LLMs to everything else** — servers, sensors, robots, serial ports, browsers, Docker containers. With safety built in at the protocol level.
24
+
25
+ ## Quickstart
26
+
27
+ ```bash
28
+ pip install halyn
29
+ ```
30
+
31
+ **Monitor a server in 5 lines:**
32
+
33
+ ```python
34
+ from halyn import ControlPlane, SSHDriver
35
+
36
+ cp = ControlPlane()
37
+ cp.connect(SSHDriver("192.168.1.10", "admin"))
38
+ print(cp.observe()) # → {"cpu": 23.4, "mem": 67.2, "disk": 45.1, ...}
39
+ ```
40
+
41
+ **Control a Raspberry Pi GPIO:**
42
+
43
+ ```python
44
+ from halyn import ControlPlane, SSHDriver
45
+
46
+ cp = ControlPlane()
47
+ cp.connect(SSHDriver("raspberrypi.local", "pi"))
48
+
49
+ # Add a safety rule: never touch GPIO 4 (connected to emergency stop)
50
+ cp.shield("deny gpio write 4")
51
+
52
+ cp.act("gpio write 17 high") # ✓ turns on LED
53
+ cp.act("gpio write 4 low") # ✗ blocked by shield rule
54
+ ```
55
+
56
+ **Let Claude control your home lab:**
57
+
58
+ ```python
59
+ from halyn import ControlPlane, SSHDriver, Autonomy
60
+
61
+ cp = ControlPlane(autonomy=Autonomy.SUPERVISED) # AI proposes, human approves
62
+ cp.connect(SSHDriver("homelab.local", "admin"))
63
+
64
+ # Shield: read-only on production, full access on staging
65
+ cp.shield("deny * write /prod/*")
66
+ cp.shield("allow * * /staging/*")
67
+
68
+ # AI can now observe and propose actions
69
+ # Human gets a prompt before anything executes
70
+ ```
71
+
72
+ ## 12 Drivers
73
+
74
+ | Driver | What It Connects | Example |
75
+ |--------|-----------------|---------|
76
+ | `SSHDriver` | Any Linux/Mac server | Monitor servers, deploy code |
77
+ | `HTTPDriver` | REST APIs, webhooks | Control smart home APIs |
78
+ | `WebSocketDriver` | Real-time streams | Live sensor data |
79
+ | `SerialDriver` | Arduino, Raspberry Pi, PLCs | Read sensors, control actuators |
80
+ | `MQTTDriver` | IoT networks | Smart agriculture, building automation |
81
+ | `OPCUADriver` | Industrial machines (Industry 4.0) | CNC, SCADA, factory equipment |
82
+ | `ROS2Driver` | Robots (ROS ecosystem) | Robot arms, mobile robots, drones |
83
+ | `DDSDriver` | Real-time distributed systems | Autonomous vehicles, defense |
84
+ | `DockerDriver` | Containers and orchestration | Scale services, manage deployments |
85
+ | `BrowserDriver` | Web automation | Fill forms, scrape data, test UIs |
86
+ | `UnitreeDriver` | Unitree robots | Go2, B2, H1 quadrupeds and humanoids |
87
+ | `SocketDriver` | Raw TCP/UDP | Custom hardware, legacy systems |
88
+
89
+ ## 5 Autonomy Levels
90
+
91
+ | Level | Name | Who Decides | Use Case |
92
+ |-------|------|-------------|----------|
93
+ | 0 | **Manual** | Human does everything | Learning, debugging |
94
+ | 1 | **Advisory** | AI suggests, human executes | Critical systems |
95
+ | 2 | **Supervised** | AI executes, human approves first | Production ops |
96
+ | 3 | **Monitored** | AI executes freely, human can intervene | Routine tasks |
97
+ | 4 | **Autonomous** | AI decides within shield rules | Fully automated systems |
98
+
99
+ ## Shield Rules — Safety as Physics
100
+
101
+ Shield rules aren't guidelines. They're constraints enforced at the protocol level. Your AI physically cannot violate them, regardless of its instructions.
102
+
103
+ ```python
104
+ # Industrial safety
105
+ cp.shield("deny actuator write pressure > 150") # never exceed 150 PSI
106
+ cp.shield("deny motor write speed > 3000") # RPM limit
107
+ cp.shield("require human_approval for emergency_stop disable")
108
+
109
+ # Data safety
110
+ cp.shield("deny * read /etc/shadow")
111
+ cp.shield("deny * write /prod/database/*")
112
+ cp.shield("deny * delete *") # read-only mode
113
+
114
+ # Rate limiting
115
+ cp.shield("limit actions 10/minute")
116
+ ```
117
+
118
+ ## Audit Chain
119
+
120
+ Every action Halyn executes is recorded in a tamper-evident SHA-256 chain. Nothing can be altered or deleted.
121
+
122
+ ```python
123
+ # View the audit trail
124
+ for entry in cp.audit.chain():
125
+ print(f"{entry.timestamp} | {entry.action} | {entry.result} | {entry.hash[:12]}")
126
+
127
+ # 2026-03-17T01:30:00 | observe cpu | 23.4% | a3f8c9d1e2b4
128
+ # 2026-03-17T01:30:01 | act restart nginx| success | 7b2e4f6a8c0d
129
+ # 2026-03-17T01:30:02 | observe cpu | 12.1% | e5d7c9b1a3f8
130
+ ```
131
+
132
+ Perfect for compliance (SOC2, ISO 27001, GDPR audit trails).
133
+
134
+ ## Use Cases
135
+
136
+ ### 🏭 Smart Factory
137
+
138
+ Connect AI to your factory floor. OPC-UA driver reads machine data. Shield rules prevent dangerous operations. Audit chain provides compliance trail.
139
+
140
+ ```python
141
+ cp = ControlPlane(autonomy=Autonomy.MONITORED)
142
+ cp.connect(OPCUADriver("opc.tcp://plc-01:4840"))
143
+ cp.shield("deny * write temperature > 200")
144
+ cp.shield("deny * write pressure > 150")
145
+
146
+ # AI monitors machines, optimizes parameters within safe bounds
147
+ # Every adjustment is audited
148
+ ```
149
+
150
+ ### 🌱 Precision Agriculture
151
+
152
+ MQTT sensors across your field report soil moisture, temperature, weather. AI decides when to irrigate, which zones need attention.
153
+
154
+ ```python
155
+ cp = ControlPlane()
156
+ cp.connect(MQTTDriver("mqtt://field-gateway:1883"))
157
+ cp.shield("limit irrigation 3/day") # prevent overwatering
158
+ cp.shield("deny irrigation if wind > 30") # no sprinklers in wind
159
+
160
+ data = cp.observe() # reads all sensors
161
+ # AI analyzes and triggers irrigation for dry zones
162
+ ```
163
+
164
+ ### 🏥 Patient Monitoring
165
+
166
+ Serial connection to medical devices. AI watches vitals 24/7, alerts staff immediately when something changes. Shield rules ensure the AI can never modify device settings.
167
+
168
+ ```python
169
+ cp = ControlPlane(autonomy=Autonomy.ADVISORY) # AI advises only
170
+ cp.connect(SerialDriver("/dev/ttyUSB0", baudrate=9600))
171
+ cp.shield("deny * write *") # read-only — AI cannot control the device
172
+
173
+ vitals = cp.observe() # heart rate, SpO2, blood pressure
174
+ # AI detects anomaly → alerts nurse station
175
+ ```
176
+
177
+ ### 🤖 Robot Fleet
178
+
179
+ ROS2 driver connects to any robot in the ROS ecosystem. Shield rules define the workspace. Consent protocol ensures robots agree before coordinating.
180
+
181
+ ```python
182
+ cp = ControlPlane()
183
+ cp.connect(ROS2Driver("robot-arm-01"))
184
+ cp.connect(ROS2Driver("robot-arm-02"))
185
+
186
+ cp.shield("deny movement outside workspace_bounds")
187
+ cp.shield("deny force > 50N") # collaborative robot limits
188
+
189
+ # Consent: robots negotiate shared workspace access
190
+ cp.consent("robot-arm-01", "robot-arm-02", scope="shared_zone_A")
191
+ ```
192
+
193
+ ### 🏠 Smart Home
194
+
195
+ Connect every device in your home. Your AI assistant can control lights, thermostat, locks — but shield rules ensure it can never unlock doors at night or set the thermostat below 15°C.
196
+
197
+ ```python
198
+ cp = ControlPlane()
199
+ cp.connect(MQTTDriver("mqtt://home-hub:1883"))
200
+
201
+ cp.shield("deny lock unlock between 23:00-06:00")
202
+ cp.shield("deny thermostat write < 15")
203
+ cp.shield("deny * * camera") # AI has no camera access
204
+
205
+ cp.act("lights living_room dim 40%")
206
+ ```
207
+
208
+ ### 🎓 Education
209
+
210
+ Students learn AI-hardware interaction in 10 lines. Connect an Arduino, read a temperature sensor, make an LED blink based on AI decisions.
211
+
212
+ ```python
213
+ from halyn import ControlPlane, SerialDriver
214
+
215
+ cp = ControlPlane()
216
+ cp.connect(SerialDriver("/dev/ttyACM0"))
217
+
218
+ temp = cp.observe()["temperature"]
219
+ if temp > 30:
220
+ cp.act("led on") # too hot → warning LED
221
+ else:
222
+ cp.act("led off")
223
+ ```
224
+
225
+ ## Built on NRP
226
+
227
+ Halyn implements [NRP (Node Reach Protocol)](https://github.com/ElmadaniS/nrp) — 6 primitives that define how AI talks to hardware:
228
+
229
+ | Primitive | Purpose |
230
+ |-----------|---------|
231
+ | **Manifest** | "I am" — device declares its identity and capabilities |
232
+ | **Observe** | "I see" — read state without side effects |
233
+ | **Act** | "I do" — execute an action on the device |
234
+ | **Shield** | "I cannot" — enforceable constraints |
235
+ | **Audit** | "I did" — tamper-evident action log |
236
+ | **Consent** | "We agree" — mutual permission negotiation |
237
+
238
+ ## Contributing
239
+
240
+ See [CONTRIBUTING.md](CONTRIBUTING.md). We especially welcome new drivers and shield rule patterns.
241
+
242
+ ## License
243
+
244
+ MIT — use it anywhere, for anything.
245
+
246
+ ---
247
+
248
+ <div align="center">
249
+
250
+ **[halyn.dev](https://halyn.dev)** · **contact@halyn.dev** · © 2026 Elmadani SALKA
251
+
252
+ </div>
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "halyn"
3
- version = "0.2.2"
3
+ version = "0.3.0"
4
4
  description = "Halyn — NRP control plane with domain-scoped authorization."
5
5
  requires-python = ">=3.10"
6
6
  license = {text = "MIT"}
7
- authors = [{name = "Elmadani SALKA", email = "Elmadani.SALKA@proton.me"}]
7
+ authors = [{name = "Elmadani SALKA", email = "contact@halyn.dev"}]
8
8
  readme = "README.md"
9
9
  keywords = ["ai", "browser", "robotics", "iot", "mcp", "nrp", "llm", "infrastructure", "devops"]
10
10
  classifiers = [
@@ -27,6 +27,7 @@ iot = ["paho-mqtt"]
27
27
  dev = ["pytest", "pytest-asyncio", "mypy", "ruff"]
28
28
 
29
29
  [project.scripts]
30
+ halyn-mcp = "halyn.mcp_serve:main"
30
31
  halyn = "halyn.cli:main"
31
32
 
32
33
  [project.urls]
@@ -2,6 +2,6 @@
2
2
  # Licensed under the MIT License. See LICENSE file.
3
3
  """Halyn — NRP control plane with domain-scoped authorization."""
4
4
 
5
- __version__ = "0.2.2"
5
+ __version__ = "0.2.3"
6
6
  __author__ = "Elmadani SALKA"
7
7
  __license__ = "MIT"