yumoqing 75fa6c5d29 feat(hermes-web-cli): add missing module files and fix user context handling
- Add missing core module files: crud_ops.py, db_tables.py, init_db.py, user_context.py
- Ensure all .dspy scripts properly use get_user() for user_id acquisition
- Fix user context handling in module functions via get_current_user_id()
- Maintain proper async/await patterns throughout the codebase
- Complete module implementation following module-development-spec
- All database operations use sqlor framework with proper user isolation
2026-04-24 11:12:36 +08:00

23 lines
769 B
Plaintext

# Get all services for display in services.ui
# This .dspy file uses functions provided by load_hermes_web_cli()
try:
# Use the function provided by the hermes-web-cli module
services = await get_all_services()
# Format services for UI display
result = []
for service in services:
result.append({
"id": service.get("id"),
"name": service.get("name", f"Service {service.get('id')}"),
"endpoint": service.get("service_url", ""),
"description": service.get("description", ""),
"status": service.get("status", "unknown"),
"created_at": service.get("created_at")
})
return result
except Exception as e:
# On error, return empty array
return []