fix(mobile): wire plugin catalog and session-scoped subagent controls
This commit is contained in:
1 parent
61d765e2df
commit
1acb5dd90f
27 files changed
+1573
-17
No files matched your search
@@ -19070,16 +19070,28 @@ async def get_plugins_hub(request: Request):
|
||||
raise HTTPException(status_code=500, detail="Failed to build plugins hub.") from exc
|
||||
|
||||
|
||||
@app.get("/api/dashboard/plugins/catalog")
|
||||
async def get_plugins_catalog(request: Request):
|
||||
_require_token(request)
|
||||
from hermes_cli.aiturk_plugin_catalog import catalog_payload
|
||||
return await asyncio.to_thread(catalog_payload)
|
||||
|
||||
|
||||
@app.post("/api/dashboard/agent-plugins/install")
|
||||
async def post_agent_plugin_install(request: Request, body: _AgentPluginInstallBody):
|
||||
_require_token(request)
|
||||
from hermes_cli.plugins_cmd import dashboard_install_plugin
|
||||
|
||||
result = dashboard_install_plugin(
|
||||
body.identifier.strip(),
|
||||
force=body.force,
|
||||
enable=body.enable,
|
||||
)
|
||||
if body.catalog_name:
|
||||
from hermes_cli.aiturk_plugin_catalog import install_catalog_plugin
|
||||
result = await asyncio.to_thread(
|
||||
install_catalog_plugin, body.catalog_name, force=body.force, enable=body.enable,
|
||||
)
|
||||
else:
|
||||
result = await asyncio.to_thread(
|
||||
dashboard_install_plugin, body.identifier.strip(), force=body.force,
|
||||
enable=body.enable, ref=body.ref,
|
||||
)
|
||||
if not result.get("ok"):
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
|
||||
Reference in new issue
Block a user