Files
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 13:10:45 +08:00

64 lines
2.7 KiB
Python

"""CLI boundary wiring — observability and integration ports.
Lives in a leaf module so ``environment`` (imported by ``renderers`` and
``tracker`` for utility plumbing) does not import those modules back —
that would create a static import cycle. Entry points (``__main__``,
MCP, remote server) and tests call :func:`install_product_adapters`
from here.
"""
from __future__ import annotations
def install_harness_ports() -> None:
"""Register integrations/tools adapters into :mod:`platform.harness_ports`.
Harness composition root for the interactive shell and tests. Lives in
``surfaces`` (not ``tools``) because ``tools`` and ``integrations`` are
sibling layers and must not import each other — see ``.importlinter.strict``.
"""
from integrations.harness_adapters import register_harness_adapters as register_integrations
from tools.harness_adapters import register_harness_adapters as register_tools
register_integrations()
register_tools()
def install_product_adapters() -> None:
"""Wire product adapters into observability and integration ports.
Call once from each process entry point (CLI, MCP, remote server).
Idempotent — re-registers the same callables so calling it twice
is a no-op.
Wires:
- debug_print: stderr default → Rich-aware CLI version
- render_investigation_header: no-op default → Rich panel
- progress tracker: Noop default → Rich-backed CLI singleton (lazy)
- remote integrations fetcher: empty default → Tracer Cloud adapter
- harness ports: catalog/store, tool registry, investigation tools, GitHub scope
"""
from integrations.tracer.integrations_adapter import (
fetch_tracer_remote_integrations,
)
from platform.harness_ports import set_remote_integrations_fetcher
from platform.observability.render.debug import set_debug_printer
from platform.observability.render.display import (
set_investigation_footer_renderer,
set_investigation_header_renderer,
)
from platform.observability.render.progress import set_progress_tracker_factory
from surfaces.interactive_shell.ui.output.environment import debug_print
from surfaces.interactive_shell.ui.output.renderers import (
render_completed_investigation_footer,
render_investigation_header,
)
from surfaces.interactive_shell.ui.output.tracker import get_tracker
set_debug_printer(debug_print)
set_investigation_header_renderer(render_investigation_header)
set_investigation_footer_renderer(render_completed_investigation_footer)
set_progress_tracker_factory(get_tracker)
set_remote_integrations_fetcher(fetch_tracer_remote_integrations)
install_harness_ports()