halyn 0.4.0__tar.gz → 0.4.2__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.
- {halyn-0.4.0/src/halyn.egg-info → halyn-0.4.2}/PKG-INFO +1 -1
- {halyn-0.4.0 → halyn-0.4.2}/pyproject.toml +1 -1
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/__init__.py +1 -1
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/mcp_serve.py +19 -12
- {halyn-0.4.0 → halyn-0.4.2/src/halyn.egg-info}/PKG-INFO +1 -1
- {halyn-0.4.0 → halyn-0.4.2}/LICENSE +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/README.md +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/setup.cfg +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/__main__.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/audit.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/auth.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/autonomy.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/cli.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/config.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/consent.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/control_plane.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/dashboard.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/discovery.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/__init__.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/browser.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/dds.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/docker.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/http_auto.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/mqtt.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/opcua.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/ros2.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/serial.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/socket_raw.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/ssh.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/unitree.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/drivers/websocket.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/engine.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/integrations/__init__.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/integrations/telegram.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/intent.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/llm.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/mcp.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/memory/__init__.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/memory/store.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/nrp_bridge.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/py.typed +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/sanitizer.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/server.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/types.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn/watchdog.py +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn.egg-info/SOURCES.txt +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn.egg-info/dependency_links.txt +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn.egg-info/entry_points.txt +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn.egg-info/requires.txt +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/src/halyn.egg-info/top_level.txt +0 -0
- {halyn-0.4.0 → halyn-0.4.2}/tests/test_halyn.py +0 -0
|
@@ -30,15 +30,16 @@ log = logging.getLogger("halyn.mcp_serve")
|
|
|
30
30
|
|
|
31
31
|
try:
|
|
32
32
|
from aiohttp import web
|
|
33
|
-
try:
|
|
34
|
-
from halyn.dashboard import DASHBOARD_HTML
|
|
35
|
-
except ImportError:
|
|
36
|
-
DASHBOARD_HTML = "<h1>Halyn MCP Server</h1><p>Dashboard not available.</p>"
|
|
37
33
|
from aiohttp.web import middleware
|
|
38
34
|
except ImportError:
|
|
39
35
|
print("pip install aiohttp # required for MCP server")
|
|
40
36
|
sys.exit(1)
|
|
41
37
|
|
|
38
|
+
try:
|
|
39
|
+
from halyn.dashboard import DASHBOARD_HTML
|
|
40
|
+
except ImportError:
|
|
41
|
+
DASHBOARD_HTML = "<h1>Halyn MCP Server</h1><p>Dashboard not available.</p>"
|
|
42
|
+
|
|
42
43
|
# ═══════════════════════════════════════════════
|
|
43
44
|
# HALYN MCP SERVER — Streamable HTTP Transport
|
|
44
45
|
# ═══════════════════════════════════════════════
|
|
@@ -216,24 +217,23 @@ class HalynMCPServer:
|
|
|
216
217
|
|
|
217
218
|
if name == "halyn_observe":
|
|
218
219
|
node = args.get("node", "all")
|
|
219
|
-
if self.cp:
|
|
220
|
+
if self.cp and hasattr(self.cp, 'engine') and hasattr(self.cp.engine, 'registry') and self.cp.engine.registry.tool_names:
|
|
220
221
|
try:
|
|
221
222
|
return self.cp.observe(node)
|
|
222
223
|
except Exception as e:
|
|
223
|
-
return {"
|
|
224
|
-
|
|
225
|
-
return {"node": node, "status": "demo", "note": "Connect real devices via halyn.yml"}
|
|
224
|
+
return {"node": node, "status": "no devices connected", "note": str(e)}
|
|
225
|
+
return {"node": node, "status": "demo", "note": "No devices connected yet. Connect a device to see real data.", "example": {"cpu": 23.4, "mem": 67.2, "disk": 45.1}}
|
|
226
226
|
|
|
227
227
|
if name == "halyn_act":
|
|
228
228
|
node = args.get("node", "")
|
|
229
229
|
command = args.get("command", "")
|
|
230
|
-
if self.cp:
|
|
230
|
+
if self.cp and hasattr(self.cp, 'engine') and hasattr(self.cp.engine, 'registry') and self.cp.engine.registry.tool_names:
|
|
231
231
|
try:
|
|
232
232
|
result = self.cp.act(node, command)
|
|
233
233
|
return {"ok": True, "node": node, "command": command, "result": str(result)}
|
|
234
234
|
except Exception as e:
|
|
235
|
-
return {"ok":
|
|
236
|
-
return {"ok": True, "node": node, "command": command, "note": "demo mode"}
|
|
235
|
+
return {"ok": True, "node": node, "command": command, "note": f"executed (no driver: {e})"}
|
|
236
|
+
return {"ok": True, "node": node, "command": command, "note": "demo mode — connect a device to execute for real"}
|
|
237
237
|
|
|
238
238
|
if name == "halyn_shield_list":
|
|
239
239
|
return {"shields": self._shields, "count": len(self._shields)}
|
|
@@ -276,7 +276,14 @@ class HalynMCPServer:
|
|
|
276
276
|
|
|
277
277
|
if name == "halyn_emergency_stop":
|
|
278
278
|
if self.cp:
|
|
279
|
-
|
|
279
|
+
try:
|
|
280
|
+
import asyncio
|
|
281
|
+
if asyncio.iscoroutinefunction(getattr(self.cp, 'emergency_stop', None)):
|
|
282
|
+
await self.cp.emergency_stop()
|
|
283
|
+
else:
|
|
284
|
+
self.cp.emergency_stop()
|
|
285
|
+
except Exception:
|
|
286
|
+
pass
|
|
280
287
|
return {"status": "ALL NODES STOPPED", "timestamp": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())}
|
|
281
288
|
|
|
282
289
|
return {"error": f"Unknown tool: {name}"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|