m8flow 1.1.7 → 1.1.8
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.
|
@@ -130,6 +130,22 @@ async def generate_node_code_route(http_request: Request, req: GenerateCodeReque
|
|
|
130
130
|
raise HTTPException(status_code=500, detail=f"{type(exc).__name__}: {exc}")
|
|
131
131
|
|
|
132
132
|
|
|
133
|
+
@router.get("/packages")
|
|
134
|
+
def list_packages():
|
|
135
|
+
"""Return all packages currently installed in the running Python environment."""
|
|
136
|
+
result = subprocess.run(
|
|
137
|
+
[sys.executable, "-m", "pip", "list", "--format=json", "--disable-pip-version-check"],
|
|
138
|
+
capture_output=True,
|
|
139
|
+
text=True,
|
|
140
|
+
timeout=30,
|
|
141
|
+
)
|
|
142
|
+
if result.returncode != 0:
|
|
143
|
+
raise HTTPException(status_code=500, detail="Failed to list packages.")
|
|
144
|
+
import json as _json
|
|
145
|
+
packages = _json.loads(result.stdout or "[]")
|
|
146
|
+
return {"packages": packages}
|
|
147
|
+
|
|
148
|
+
|
|
133
149
|
@router.get("/templates")
|
|
134
150
|
def list_templates():
|
|
135
151
|
"""Return every prebuilt template with its pre-parsed schema attached."""
|