From 558aa984911fa395e49a7bad63d81a71de898312 Mon Sep 17 00:00:00 2001 From: Xubin Ren Date: Tue, 21 Apr 2026 14:33:44 +0000 Subject: [PATCH] chore: temporary keep WebUI source-only --- nanobot/cli/commands.py | 62 ------------------------ pyproject.toml | 7 --- webui/README.md | 6 +-- webui/src/i18n/locales/en/common.json | 2 +- webui/src/i18n/locales/es/common.json | 2 +- webui/src/i18n/locales/fr/common.json | 2 +- webui/src/i18n/locales/id/common.json | 2 +- webui/src/i18n/locales/ja/common.json | 2 +- webui/src/i18n/locales/ko/common.json | 2 +- webui/src/i18n/locales/vi/common.json | 2 +- webui/src/i18n/locales/zh-CN/common.json | 2 +- webui/src/i18n/locales/zh-TW/common.json | 2 +- 12 files changed, 12 insertions(+), 81 deletions(-) diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index ec572ffe..7892df0e 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -950,68 +950,6 @@ def _run_gateway( asyncio.run(run()) -@app.command() -def web( - port: int | None = typer.Option(None, "--port", "-p", help="WebSocket port for the webui"), - workspace: str | None = typer.Option(None, "--workspace", "-w", help="Workspace directory"), - verbose: bool = typer.Option(False, "--verbose", "-v", help="Verbose output"), - config: str | None = typer.Option(None, "--config", "-c", help="Path to config file"), - open_browser: bool = typer.Option(True, "--open/--no-open", help="Open the browser when ready"), -): - """Start the gateway with the embedded webui and (by default) open a browser.""" - if verbose: - import logging - - logging.basicConfig(level=logging.DEBUG) - - cfg = _load_runtime_config(config, workspace) - - # Force the websocket channel on with token-gated auth so the webui is functional. - # ``--port`` applies to the webui's websocket/HTTP port, not the gateway's - # management port, since that's the only surface users visit. - ws_section = cfg.channels.websocket - if isinstance(ws_section, dict): - ws_section.setdefault("host", "127.0.0.1") - ws_section["enabled"] = True - ws_section["websocketRequiresToken"] = True - if port is not None: - ws_section["port"] = port - ws_host = ws_section.get("host", "127.0.0.1") - ws_port = ws_section.get("port", 8765) - ws_path = ws_section.get("path", "/") - else: - ws_section.enabled = True - if hasattr(ws_section, "websocket_requires_token"): - ws_section.websocket_requires_token = True - if port is not None: - ws_section.port = port - ws_host = getattr(ws_section, "host", "127.0.0.1") or "127.0.0.1" - ws_port = getattr(ws_section, "port", 8765) - ws_path = getattr(ws_section, "path", "/") or "/" - - # Confirm the bundled SPA exists before promising the user a browser launch. - from nanobot.channels.manager import _default_webui_dist - - dist = _default_webui_dist() - if dist is None: - console.print( - "[yellow]Warning: webui assets not found at nanobot/web/dist/. " - "Run `cd webui && bun install && bun run build` from a source checkout.[/yellow]" - ) - - scheme = "http" - # Browsers refuse cookies/JS on 0.0.0.0 — collapse to loopback for the visit URL. - visit_host = "127.0.0.1" if ws_host in {"0.0.0.0", "::"} else ws_host - open_url = f"{scheme}://{visit_host}:{ws_port}{ws_path if ws_path != '/' else ''}/" - - # The gateway's management port is separate from the webui port; leave it - # on its configured default so --port only moves the visible surface. - _run_gateway( - cfg, - open_browser_url=open_url if open_browser else None, - ) - - # ============================================================================ # Agent Commands # ============================================================================ diff --git a/pyproject.toml b/pyproject.toml index 3447ffc3..e7282abf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,13 +118,6 @@ include = [ "nanobot/skills/**/*.md", "nanobot/skills/**/*.sh", ] -# Build-time generated assets that live under .gitignore'd paths but must ship -# in the wheel/sdist. `artifacts` bypasses the VCS filter (unlike `include`). -# The webui is compiled via `bun run build` into nanobot/web/dist/ right before -# `python -m build` runs. -artifacts = [ - "nanobot/web/dist/**/*", -] [tool.hatch.build.targets.wheel] packages = ["nanobot"] diff --git a/webui/README.md b/webui/README.md index d318c745..602b179e 100644 --- a/webui/README.md +++ b/webui/README.md @@ -1,6 +1,6 @@ # nanobot webui -The browser front-end for `nanobot web`. It is built with Vite + React 18 + +The browser front-end for the nanobot gateway. It is built with Vite + React 18 + TypeScript + Tailwind 3 + shadcn/ui, talks to the gateway over the WebSocket multiplex protocol, and reads session metadata from the embedded REST surface on the same port. @@ -22,7 +22,7 @@ For the project overview, install guide, and general docs map, see the root ```text webui/ source tree (this directory) -nanobot/web/dist/ build output consumed by `nanobot web` +nanobot/web/dist/ build output served by the gateway ``` ## Develop from source @@ -80,7 +80,7 @@ bun run build ``` This writes the production assets to `../nanobot/web/dist`, which is the -directory served by `nanobot web` and bundled into the Python wheel. +directory served by `nanobot gateway` and bundled into the Python wheel. If you are cutting a release, run the build before packaging so the published wheel contains the current WebUI assets. diff --git a/webui/src/i18n/locales/en/common.json b/webui/src/i18n/locales/en/common.json index 9fc01663..0b0f3406 100644 --- a/webui/src/i18n/locales/en/common.json +++ b/webui/src/i18n/locales/en/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "Couldn't reach nanobot", - "gatewayHint": "Make sure the gateway is running (`nanobot web`) and that this page is open on the same machine." + "gatewayHint": "Make sure the gateway is running (`nanobot gateway`) and that this page is open on the same machine." }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/es/common.json b/webui/src/i18n/locales/es/common.json index 1c099364..2f11a2fb 100644 --- a/webui/src/i18n/locales/es/common.json +++ b/webui/src/i18n/locales/es/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "No se pudo conectar con nanobot", - "gatewayHint": "Asegúrate de que la gateway esté en ejecución (`nanobot web`) y de que esta página esté abierta en la misma máquina." + "gatewayHint": "Asegúrate de que la gateway esté en ejecución (`nanobot gateway`) y de que esta página esté abierta en la misma máquina." }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/fr/common.json b/webui/src/i18n/locales/fr/common.json index 75e4753d..33d59c72 100644 --- a/webui/src/i18n/locales/fr/common.json +++ b/webui/src/i18n/locales/fr/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "Impossible de joindre nanobot", - "gatewayHint": "Assurez-vous que la gateway est en cours d’exécution (`nanobot web`) et que cette page est ouverte sur la même machine." + "gatewayHint": "Assurez-vous que la gateway est en cours d’exécution (`nanobot gateway`) et que cette page est ouverte sur la même machine." }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/id/common.json b/webui/src/i18n/locales/id/common.json index 6085046e..f37132bd 100644 --- a/webui/src/i18n/locales/id/common.json +++ b/webui/src/i18n/locales/id/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "Tidak dapat menjangkau nanobot", - "gatewayHint": "Pastikan gateway sedang berjalan (`nanobot web`) dan halaman ini dibuka pada mesin yang sama." + "gatewayHint": "Pastikan gateway sedang berjalan (`nanobot gateway`) dan halaman ini dibuka pada mesin yang sama." }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/ja/common.json b/webui/src/i18n/locales/ja/common.json index 5f76ac0c..8529e9a8 100644 --- a/webui/src/i18n/locales/ja/common.json +++ b/webui/src/i18n/locales/ja/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "nanobot に接続できませんでした", - "gatewayHint": "gateway(`nanobot web`)が起動しており、このページが同じマシン上で開かれていることを確認してください。" + "gatewayHint": "gateway(`nanobot gateway`)が起動しており、このページが同じマシン上で開かれていることを確認してください。" }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/ko/common.json b/webui/src/i18n/locales/ko/common.json index bc840764..a1e52aca 100644 --- a/webui/src/i18n/locales/ko/common.json +++ b/webui/src/i18n/locales/ko/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "nanobot에 연결할 수 없습니다", - "gatewayHint": "gateway(`nanobot web`)가 실행 중인지, 그리고 이 페이지가 같은 머신에서 열려 있는지 확인하세요." + "gatewayHint": "gateway(`nanobot gateway`)가 실행 중인지, 그리고 이 페이지가 같은 머신에서 열려 있는지 확인하세요." }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/vi/common.json b/webui/src/i18n/locales/vi/common.json index d648f60e..33099878 100644 --- a/webui/src/i18n/locales/vi/common.json +++ b/webui/src/i18n/locales/vi/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "Không thể kết nối tới nanobot", - "gatewayHint": "Hãy chắc chắn gateway đang chạy (`nanobot web`) và trang này được mở trên cùng máy." + "gatewayHint": "Hãy chắc chắn gateway đang chạy (`nanobot gateway`) và trang này được mở trên cùng máy." }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/zh-CN/common.json b/webui/src/i18n/locales/zh-CN/common.json index 67a12f3f..ae7815e9 100644 --- a/webui/src/i18n/locales/zh-CN/common.json +++ b/webui/src/i18n/locales/zh-CN/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "无法连接到 nanobot", - "gatewayHint": "请确认 gateway 已启动(`nanobot web`),并且当前页面与 gateway 运行在同一台机器上。" + "gatewayHint": "请确认 gateway 已启动(`nanobot gateway`),并且当前页面与 gateway 运行在同一台机器上。" }, "documentTitle": { "base": "nanobot", diff --git a/webui/src/i18n/locales/zh-TW/common.json b/webui/src/i18n/locales/zh-TW/common.json index 743ca587..f606a7f1 100644 --- a/webui/src/i18n/locales/zh-TW/common.json +++ b/webui/src/i18n/locales/zh-TW/common.json @@ -7,7 +7,7 @@ }, "error": { "title": "無法連線到 nanobot", - "gatewayHint": "請確認 gateway 已啟動(`nanobot web`),並且目前頁面與 gateway 在同一台機器上開啟。" + "gatewayHint": "請確認 gateway 已啟動(`nanobot gateway`),並且目前頁面與 gateway 在同一台機器上開啟。" }, "documentTitle": { "base": "nanobot",