yumoqing 9a5158d09a fix: Simplify init.py according to correct module development rules
- Update init.py to only expose variables/functions for web scripts (no routing)
- Remove api.py (routing is automatic for wwwroot files)
- Add MODULE_DEVELOPMENT_SPEC_UPDATE.md with clarified rules
- Follow proper module development specification
2026-04-21 14:43:26 +08:00

27 lines
931 B
Python

# hermes-web-cli module initialization
# This file exposes variables and functions for use by other modules and web scripts (.ui, .dspy)
# Module metadata
MODULE_NAME = "hermes-web-cli"
MODULE_VERSION = "0.1.0"
# Configuration constants
DEFAULT_SERVICE_URL = "http://localhost:9120"
SUPPORTED_SERVICE_STATUS = ["active", "inactive", "disconnected"]
# Helper functions that can be used by .ui or .dspy scripts
def get_service_config(service_id):
"""Get service configuration by ID - can be called from .ui scripts"""
# This would typically query the database
pass
def validate_service_url(url):
"""Validate service URL format - can be called from .ui scripts"""
return url.startswith(('http://', 'https://'))
def create_session_id():
"""Generate a new session ID - can be called from .ui scripts"""
import uuid
return str(uuid.uuid4())
# Any other variables or functions needed by web scripts