mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-27 15:17:18 +09:00
Comments, docstrings and a few strings cited plan numbers ("plan 29
#9", "plan 86 §B2") from a git-ignored folder, so they pointed at
nothing; one reached users in a bottleneck hint. Code and frontend
strings are unchanged apart from those citations (checked by AST and
token comparison). A vhost still carrying the old asset comment reads
as undrifted, and a guard test keeps new citations out.
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Shared wire-protocol constants.
|
|
|
|
``SOCKET_EVENTS`` is mirrored verbatim by ``frontend/src/constants/events.js``
|
|
so a renamed event cannot fail silently — ``tests/test_socket_contract.py``
|
|
parses the JS file and asserts the two tables are identical. Add or rename an
|
|
event in BOTH files (the test tells you when you forgot).
|
|
"""
|
|
|
|
SOCKET_EVENTS = {
|
|
# lifecycle / control plane
|
|
'CONNECTED': 'connected',
|
|
'ERROR': 'error',
|
|
'SUBSCRIBED': 'subscribed',
|
|
'UNSUBSCRIBED': 'unsubscribed',
|
|
'JOINED': 'joined',
|
|
'LEFT': 'left',
|
|
|
|
# broadcast channels
|
|
'METRICS': 'metrics',
|
|
'CONTAINER_STATUS': 'container_status',
|
|
'NOTIFICATION': 'notification',
|
|
|
|
# file log streaming
|
|
'LOG_LINE': 'log_line',
|
|
'LOG_ERROR': 'log_error',
|
|
|
|
# deploy console (legacy names, dual-emitted with the run envelope)
|
|
'DEPLOY_LOG': 'deploy_log',
|
|
'DEPLOY_STATUS': 'deploy_status',
|
|
|
|
# generalized run envelope — one event pair for every run kind
|
|
'RUN_LOG': 'run_log',
|
|
'RUN_STATUS': 'run_status',
|
|
|
|
# container log streaming
|
|
'CONTAINER_LOG': 'container_log',
|
|
'CONTAINER_LOG_ERROR': 'container_log_error',
|
|
'CONTAINER_LOG_ENDED': 'container_log_ended',
|
|
|
|
# agent stream rebroadcast (metrics / PTY / arbitrary channels)
|
|
'SERVER_STREAM': 'server_stream',
|
|
}
|