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

20 lines
761 B
Plaintext

1|# Get hermes_services list for code dropdown
2|# This .dspy file uses functions released by load_hermes_web_cli()
3|
4|try:
5| # Use the function provided by hermes-web-cli module
6| services = await get_all_services()
7|
8| # Format for code component (value, text pairs)
9| result = []
10| for service in services:
11| result.append({
12| "value": str(service.get('id')),
13| "text": service.get('name', f"Service {service.get('id')}")
14| })
15|
16| # Return array directly for code component
17| return result
18|except Exception as e:
19| # On error or no data, return empty array
20| return []