- task event stream (_append_event) is now the sole realtime channel for web and CLI - status snapshots: idle 5s polling of /api/status (was status_update push); operation initiator gets state from REST responses - terminal panel: REST polling (list 5s, output 1.5s, prefix-matched incremental xterm writes) - multi-tab passive sync deliberately degrades to polling-based perception - delete socket_handlers/broadcast/useLegacySocket (2103-line dead file); extensions.py keeps only run_background - remove socket token chain (/api/socket-token, prune/consume_socket_token, pending_socket_tokens) - app.run(threaded=True) replaces socketio.run; reapers switched to plain threading - drop flask-socketio/socket.io-client/websockets dependencies - docs: AGENTS.md section 12.5 (replacement map + hard constraints), plus CLI rewrite companion doc updates Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
16 lines
517 B
Python
16 lines
517 B
Python
"""Web server package entry.
|
||
|
||
使用 PEP 562 惰性导入:避免 `python -m server.app` 时因包级提前 import
|
||
导致 'server.app' 被加载两次(runpy RuntimeWarning)。
|
||
"""
|
||
import importlib
|
||
|
||
__all__ = ["app", "run_server", "parse_arguments", "initialize_system", "resource_busy_page"]
|
||
|
||
|
||
def __getattr__(name):
|
||
if name in __all__:
|
||
module = importlib.import_module(".app", __name__)
|
||
return getattr(module, name)
|
||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|