4b6817381b
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
CI / coverage-report (push) Has been cancelled
CI / test-kubernetes (push) Has been cancelled
CI / should-run-thorough (push) Has been cancelled
CI / test-thorough (cloudwatch-demo) (push) Has been cancelled
CI / test-thorough (flink-ecs) (push) Has been cancelled
CI / test-thorough (upstream-lambda) (push) Has been cancelled
CI / test-thorough (prefect-ecs-fargate) (push) Has been cancelled
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Has been cancelled
Benchmark image — build + push to ECR (any adapter) / build + push (push) Has been cancelled
CI / quality (ubuntu-latest) (push) Has been cancelled
CI / test (tools-runtime) (push) Has been cancelled
CI / test (e2e-general) (push) Has been cancelled
CI / test (cli-runtime) (push) Has been cancelled
CI / test (e2e-provider-and-openclaw) (push) Has been cancelled
CI / test (integrations-and-misc) (push) Has been cancelled
Release / verify (push) Has been cancelled
Release / build-python-dist (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Has been cancelled
Release / publish-release (push) Has been cancelled
Release / publish-main-release (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Has been cancelled
Release / prepare (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Has been cancelled
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Has been cancelled
132 lines
3.7 KiB
Python
132 lines
3.7 KiB
Python
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
from platform.terminal.theme import (
|
|
ANSI_DIM,
|
|
ANSI_RESET,
|
|
BG,
|
|
BOLD_BRAND,
|
|
DEVICE_CODE,
|
|
DEVICE_CODE_ANSI,
|
|
DIM,
|
|
DIM_COUNTER_ANSI,
|
|
ERROR,
|
|
HIGHLIGHT,
|
|
MARKDOWN_THEME,
|
|
PROMPT_ACCENT_ANSI,
|
|
PROMPT_FRAME_ANSI,
|
|
SECONDARY,
|
|
TEXT,
|
|
WARNING,
|
|
)
|
|
from surfaces.interactive_shell.ui.banner import render_banner, render_ready_box
|
|
from surfaces.interactive_shell.ui.components import (
|
|
print_valid_choice_list,
|
|
repl_choose_one,
|
|
repl_section_break,
|
|
repl_tty_interactive,
|
|
)
|
|
from surfaces.interactive_shell.ui.components.rendering import (
|
|
print_repl_json,
|
|
print_repl_table,
|
|
refresh_welcome_poster,
|
|
repl_print,
|
|
repl_table,
|
|
)
|
|
|
|
if TYPE_CHECKING:
|
|
from surfaces.interactive_shell.ui.agents.agents_view import (
|
|
_build_agents_table,
|
|
render_agents_table,
|
|
)
|
|
from surfaces.interactive_shell.ui.streaming import (
|
|
STREAM_LABEL_ANSWER,
|
|
STREAM_LABEL_ASSISTANT,
|
|
stream_to_console,
|
|
)
|
|
from surfaces.interactive_shell.ui.tables import (
|
|
MCP_INTEGRATION_SERVICES,
|
|
ColumnDef,
|
|
print_command_output,
|
|
render_integrations_table,
|
|
render_mcp_table,
|
|
render_models_table,
|
|
render_table,
|
|
render_tools_table,
|
|
resolve_provider_models,
|
|
)
|
|
|
|
# Heavy re-exports resolved lazily so importing ``ui`` (done on every REPL boot
|
|
# via the prompt/completion path) does not force the table + streaming stack.
|
|
_LAZY_SUBMODULE_EXPORTS: dict[str, str] = {
|
|
"_build_agents_table": "surfaces.interactive_shell.ui.agents",
|
|
"render_agents_table": "surfaces.interactive_shell.ui.agents",
|
|
"STREAM_LABEL_ANSWER": "surfaces.interactive_shell.ui.streaming",
|
|
"STREAM_LABEL_ASSISTANT": "surfaces.interactive_shell.ui.streaming",
|
|
"stream_to_console": "surfaces.interactive_shell.ui.streaming",
|
|
"MCP_INTEGRATION_SERVICES": "surfaces.interactive_shell.ui.tables",
|
|
"ColumnDef": "surfaces.interactive_shell.ui.tables",
|
|
"print_command_output": "surfaces.interactive_shell.ui.tables",
|
|
"render_integrations_table": "surfaces.interactive_shell.ui.tables",
|
|
"render_mcp_table": "surfaces.interactive_shell.ui.tables",
|
|
"render_models_table": "surfaces.interactive_shell.ui.tables",
|
|
"render_table": "surfaces.interactive_shell.ui.tables",
|
|
"render_tools_table": "surfaces.interactive_shell.ui.tables",
|
|
"resolve_provider_models": "surfaces.interactive_shell.ui.tables",
|
|
}
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
module_path = _LAZY_SUBMODULE_EXPORTS.get(name)
|
|
if module_path is None:
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
import importlib
|
|
|
|
return getattr(importlib.import_module(module_path), name)
|
|
|
|
|
|
__all__ = [
|
|
"ANSI_DIM",
|
|
"ANSI_RESET",
|
|
"BG",
|
|
"BOLD_BRAND",
|
|
"ColumnDef",
|
|
"DEVICE_CODE",
|
|
"DEVICE_CODE_ANSI",
|
|
"DIM",
|
|
"DIM_COUNTER_ANSI",
|
|
"ERROR",
|
|
"HIGHLIGHT",
|
|
"MCP_INTEGRATION_SERVICES",
|
|
"MARKDOWN_THEME",
|
|
"PROMPT_ACCENT_ANSI",
|
|
"PROMPT_FRAME_ANSI",
|
|
"SECONDARY",
|
|
"STREAM_LABEL_ANSWER",
|
|
"STREAM_LABEL_ASSISTANT",
|
|
"TEXT",
|
|
"WARNING",
|
|
"_build_agents_table",
|
|
"print_valid_choice_list",
|
|
"print_command_output",
|
|
"print_repl_json",
|
|
"print_repl_table",
|
|
"render_agents_table",
|
|
"refresh_welcome_poster",
|
|
"render_banner",
|
|
"render_ready_box",
|
|
"render_integrations_table",
|
|
"render_mcp_table",
|
|
"render_models_table",
|
|
"render_table",
|
|
"render_tools_table",
|
|
"repl_choose_one",
|
|
"repl_print",
|
|
"repl_section_break",
|
|
"repl_table",
|
|
"repl_tty_interactive",
|
|
"resolve_provider_models",
|
|
"stream_to_console",
|
|
]
|