refactor(cli)!: remove deprecated textual TUI; web console is the interactive surface
The textual TUI (tui.py) is superseded by the web console (ratatoskr-web) and is removed per the no-backwards-compat rule. The `ratatoskr` command stays as a headless client: --send / --whoami / --characters / --set-persona-pad / --seed-first-message still work; invoking it with no --send now returns a usage error (rc 10) instead of launching the TUI. Removed: src/ratatoskr/tui.py, tests/test_tui.py, the textual + textual-dev deps, and cli.py's run_tui launch path. cli.py's shared exports (USER_AGENT, ParsedArgs, formatters) stay — web/entrypoint.py and tier3.py depend on them. BREAKING CHANGE: the interactive `ratatoskr --agent X` TUI is gone; use the web console (ratatoskr-web) for interactive debugging, or --send for scripted. Verified: full suite 520 passed; ratatoskr --help exit 0; no-send -> rc 10; web/provider/tier3 import clean; textual absent from the lockfile.
This commit is contained in:
+11
-17
@@ -150,7 +150,8 @@ class TestParseArgs:
|
||||
assert args.server_url == "flag"
|
||||
|
||||
def test_no_send_marks_tui_mode(self) -> None:
|
||||
"""no_send_marks_tui_mode: missing --send → send_content=None (TUI marker)."""
|
||||
"""no_send_marks_tui_mode: missing --send → send_content=None (the no-headless-
|
||||
action marker; main() then returns a usage error since the TUI was removed)."""
|
||||
args = _parse_args(["--new", "--agent", "mimir", "--api-key", "k"])
|
||||
assert args.send_content is None
|
||||
# Other fields still populate normally
|
||||
@@ -184,8 +185,8 @@ class TestParseArgs:
|
||||
_parse_args(["--send", "hi", "--api-key", "k"])
|
||||
|
||||
def test_bare_tui_mode_accepted(self) -> None:
|
||||
"""bare_tui_mode (slice b2): no --send, no --session, no --new → valid;
|
||||
_resolve_then_run drives the startup session picker (design-brief §4)."""
|
||||
"""bare_tui_mode (slice b2): no --send, no --session, no --new → parses valid
|
||||
(send_content=None); main() then returns a usage error (the TUI was removed)."""
|
||||
args = _parse_args(["--api-key", "k"])
|
||||
assert args.send_content is None
|
||||
assert args.session_id is None
|
||||
@@ -1414,29 +1415,22 @@ class TestMain:
|
||||
# argparse prints help text to stdout
|
||||
assert "ratatoskr" in capsys.readouterr().out
|
||||
|
||||
def test_no_send_dispatches_to_tui(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""no_send_dispatches_to_tui: --send omitted → main calls run_tui, NOT _amain."""
|
||||
from ratatoskr import tui as tui_mod
|
||||
|
||||
tui_calls: list[ParsedArgs] = []
|
||||
def test_no_send_is_usage_error(
|
||||
self, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
||||
) -> None:
|
||||
"""no_send_is_usage_error: --send omitted → usage error (rc 10, the interactive
|
||||
TUI was removed in v0.21.0), and _amain is NOT called."""
|
||||
amain_calls: list[int] = []
|
||||
|
||||
def fake_run_tui(args: ParsedArgs) -> int:
|
||||
tui_calls.append(args)
|
||||
return 0
|
||||
|
||||
async def fake_amain(args: ParsedArgs) -> int:
|
||||
amain_calls.append(1)
|
||||
return 0
|
||||
|
||||
monkeypatch.setattr(tui_mod, "run_tui", fake_run_tui)
|
||||
monkeypatch.setattr(cli_mod, "_amain", fake_amain)
|
||||
rc = main(["--session", "s-1", "--api-key", "k"])
|
||||
assert rc == 0
|
||||
assert len(tui_calls) == 1
|
||||
assert tui_calls[0].send_content is None
|
||||
assert tui_calls[0].session_id == "s-1"
|
||||
assert rc == 10
|
||||
assert amain_calls == []
|
||||
assert "TUI has been removed" in capsys.readouterr().err
|
||||
|
||||
|
||||
class TestBifrostBindCli:
|
||||
|
||||
Reference in New Issue
Block a user