netx/netx_api/webcrt_service.py
oliver 96b76294b4 Split UME sync and WebCRT session into focused modules.
Keep public facades stable, re-export symbols tests patch, and fix missing threading import plus reaper fixture state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 17:12:55 +08:00

83 lines
2 KiB
Python

"""WebCRT facade — re-exports channel helpers and session registry."""
from __future__ import annotations
from .config import settings
from .ne_session_factory import get_cli_hop_guard, open_netmiko_connection
from .webcrt_channel import (
_BoundedByteQueue,
_audit,
_capture_raw_channel,
_decode_bytes,
_encode_text,
_is_prompt_only_echo,
_looks_like_cli_prompt,
_looks_like_login_prompt,
_looks_like_password_change_prompt,
_normalize_encoding,
_session_log_path,
channel_return,
map_network_cli_enter,
map_network_cli_keys,
normalize_cli_transcript,
prepare_bootstrap_output,
read_session_log_tail,
uses_network_cli_keymap,
webcrt_data_root,
)
from .webcrt_session import (
WebcrtSession,
_webcrt_creds_ready,
active_session_count,
close_session,
create_session,
detach_session,
find_ssh_session_for_ne,
get_session,
list_sessions,
mark_attached,
wait_session_ready,
)
from .webcrt_session_registry import (
_reap_sessions,
_sessions,
_sessions_lock,
)
__all__ = [
"WebcrtSession",
"_BoundedByteQueue",
"_audit",
"_capture_raw_channel",
"_decode_bytes",
"_encode_text",
"_is_prompt_only_echo",
"_looks_like_cli_prompt",
"_looks_like_login_prompt",
"_looks_like_password_change_prompt",
"_normalize_encoding",
"_reap_sessions",
"_session_log_path",
"_sessions",
"_sessions_lock",
"_webcrt_creds_ready",
"active_session_count",
"channel_return",
"close_session",
"create_session",
"detach_session",
"find_ssh_session_for_ne",
"get_cli_hop_guard",
"get_session",
"list_sessions",
"map_network_cli_enter",
"map_network_cli_keys",
"mark_attached",
"normalize_cli_transcript",
"open_netmiko_connection",
"prepare_bootstrap_output",
"read_session_log_tail",
"settings",
"uses_network_cli_keymap",
"wait_session_ready",
"webcrt_data_root",
]