lithe-cli 0.8.3__tar.gz → 0.8.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lithe-cli might be problematic. Click here for more details.
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/PKG-INFO +1 -1
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/__init__.py +1 -1
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/main.py +2 -1
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/ttui.py +9 -3
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/tui.py +5 -2
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli.egg-info/PKG-INFO +1 -1
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/tests/test_ttui.py +49 -1
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/LICENSE +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/README.md +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/__main__.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/agent.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/commands.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/config.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/profiles.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/prompts.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/py.typed +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/sessions.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/setup.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/ui.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli/workbench.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli.egg-info/SOURCES.txt +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli.egg-info/dependency_links.txt +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli.egg-info/entry_points.txt +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli.egg-info/requires.txt +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/lithe_cli.egg-info/top_level.txt +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/pyproject.toml +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/setup.cfg +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/tests/test_cli.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/tests/test_cli_sessions.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/tests/test_profiles.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/tests/test_tui_v2.py +0 -0
- {lithe_cli-0.8.3 → lithe_cli-0.8.4}/tests/test_workbench.py +0 -0
|
@@ -618,7 +618,8 @@ def _run_textual(cfg: Any, task: str | None, mode: str, args: Any) -> int:
|
|
|
618
618
|
f"Textual 前端不可用({exc})。pip install textual,"
|
|
619
619
|
"或用 --ui prompt 走旧版界面。"
|
|
620
620
|
) from exc
|
|
621
|
-
|
|
621
|
+
# run_textual_screen is sync: it drives its own asyncio.run inside.
|
|
622
|
+
return run_textual_screen(cfg, task, mode, args)
|
|
622
623
|
|
|
623
624
|
|
|
624
625
|
def main(argv: list[str] | None = None) -> int:
|
|
@@ -661,9 +661,10 @@ class LitheApp(App):
|
|
|
661
661
|
f"{row['key']:<10} {shown:<4}{row['label']}",
|
|
662
662
|
))
|
|
663
663
|
else:
|
|
664
|
+
shown = "off" if value is None else value
|
|
664
665
|
items.append((
|
|
665
666
|
{"kind": "hint"},
|
|
666
|
-
f" {row['key']:<10} {
|
|
667
|
+
f" {row['key']:<10} {shown!s:<6}{row['label']}"
|
|
667
668
|
f"(/set {row['key']} 值)",
|
|
668
669
|
))
|
|
669
670
|
self.push_screen(PickerModal(
|
|
@@ -671,9 +672,11 @@ class LitheApp(App):
|
|
|
671
672
|
"Enter 切换开关 · 数值项用 /set 名称 值 · Esc 关闭",
|
|
672
673
|
), self._set_picked)
|
|
673
674
|
elif name == "reasoning":
|
|
675
|
+
from .workbench import REASONING_LEVELS
|
|
676
|
+
|
|
674
677
|
current = self.cfg.reasoning_effort or "off"
|
|
675
678
|
items = []
|
|
676
|
-
for level in
|
|
679
|
+
for level in REASONING_LEVELS:
|
|
677
680
|
active = level == current
|
|
678
681
|
label = {"off": "关闭(不发送该字段)"}.get(level, level)
|
|
679
682
|
items.append((
|
|
@@ -710,6 +713,7 @@ class LitheApp(App):
|
|
|
710
713
|
self.state.say(cls, text)
|
|
711
714
|
self._refresh_meta()
|
|
712
715
|
self._refresh_chrome()
|
|
716
|
+
self._sync_feed()
|
|
713
717
|
|
|
714
718
|
def _picker_save_reasoning(self, payload) -> None:
|
|
715
719
|
if not payload:
|
|
@@ -719,6 +723,7 @@ class LitheApp(App):
|
|
|
719
723
|
self.state.say(cls, text)
|
|
720
724
|
self._refresh_meta()
|
|
721
725
|
self._refresh_chrome()
|
|
726
|
+
self._sync_feed()
|
|
722
727
|
|
|
723
728
|
def _set_picked(self, result) -> None:
|
|
724
729
|
if not result or result[0] != "select" or not result[1]:
|
|
@@ -726,12 +731,13 @@ class LitheApp(App):
|
|
|
726
731
|
payload = result[1]
|
|
727
732
|
if payload.get("kind") == "hint":
|
|
728
733
|
return
|
|
729
|
-
r = self.wb.set_setting(payload["key"]
|
|
734
|
+
r = self.wb.set_setting(payload["key"]) # bare value toggles booleans
|
|
730
735
|
for cls, text in r.messages:
|
|
731
736
|
self.state.say(cls, text)
|
|
732
737
|
if r.changed:
|
|
733
738
|
self._refresh_meta()
|
|
734
739
|
self._refresh_chrome()
|
|
740
|
+
self._sync_feed()
|
|
735
741
|
|
|
736
742
|
def _sessions_picked(self, result) -> None:
|
|
737
743
|
if not result:
|
|
@@ -766,8 +766,9 @@ def settings_overlay_items(setting_rows: list[dict]) -> list[dict]:
|
|
|
766
766
|
"active": bool(value),
|
|
767
767
|
})
|
|
768
768
|
else:
|
|
769
|
+
shown = "off" if value is None else value
|
|
769
770
|
items.append({"kind": "hint",
|
|
770
|
-
"label": f" {row['key']:<10} {
|
|
771
|
+
"label": f" {row['key']:<10} {shown!s:<6}{row['label']}"
|
|
771
772
|
f"(/set {row['key']} 值)"})
|
|
772
773
|
items.append({"kind": "hint",
|
|
773
774
|
"label": "Enter 切换开关 · 数值项用 /set 名称 值 · Esc 关闭"})
|
|
@@ -1294,10 +1295,12 @@ async def run_screen(cfg, task, mode, args=None):
|
|
|
1294
1295
|
settings_overlay_items(wb.settings_rows()),
|
|
1295
1296
|
)
|
|
1296
1297
|
elif name == "reasoning":
|
|
1298
|
+
from .workbench import REASONING_LEVELS
|
|
1299
|
+
|
|
1297
1300
|
state.open_overlay(
|
|
1298
1301
|
"reasoning", "推理强度",
|
|
1299
1302
|
reasoning_overlay_items(cfg.reasoning_effort,
|
|
1300
|
-
|
|
1303
|
+
REASONING_LEVELS),
|
|
1301
1304
|
)
|
|
1302
1305
|
|
|
1303
1306
|
def _after_switch():
|
|
@@ -10,7 +10,13 @@ from conftest import _tc, make_config
|
|
|
10
10
|
|
|
11
11
|
textual = pytest.importorskip("textual")
|
|
12
12
|
|
|
13
|
-
from lithe_cli.ttui import
|
|
13
|
+
from lithe_cli.ttui import ( # noqa: E402
|
|
14
|
+
LitheApp,
|
|
15
|
+
PickerModal,
|
|
16
|
+
footer_text,
|
|
17
|
+
header_text,
|
|
18
|
+
sidebar_markup,
|
|
19
|
+
)
|
|
14
20
|
from lithe_cli.tui import TuiState # noqa: E402
|
|
15
21
|
|
|
16
22
|
WRITE_THEN_ANSWER = [
|
|
@@ -306,3 +312,45 @@ def test_resolve_ui_defaults_to_textual(monkeypatch):
|
|
|
306
312
|
assert _resolve_ui(args) == "prompt" # flag beats env
|
|
307
313
|
monkeypatch.setenv("LITHE_UI", "garbage")
|
|
308
314
|
assert _resolve_ui(Args()) == "textual" # unknown values fall back
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def test_f6_opens_reasoning_picker_and_applies(tmp_path):
|
|
318
|
+
"""Regression: F6 crashed with AttributeError (wb.REASONING_LEVELS)."""
|
|
319
|
+
|
|
320
|
+
async def scenario():
|
|
321
|
+
app = _app(tmp_path, [])
|
|
322
|
+
async with app.run_test(size=(100, 30)) as pilot:
|
|
323
|
+
await pilot.press("f6")
|
|
324
|
+
await pilot.pause()
|
|
325
|
+
assert isinstance(app.screen, PickerModal)
|
|
326
|
+
levels = [p["level"] for p, _ in app.screen.items]
|
|
327
|
+
assert levels == ["off", "minimal", "low", "medium", "high"]
|
|
328
|
+
for _ in range(4): # off -> high
|
|
329
|
+
await pilot.press("down")
|
|
330
|
+
await pilot.press("enter")
|
|
331
|
+
await pilot.pause()
|
|
332
|
+
assert app.cfg.reasoning_effort == "high"
|
|
333
|
+
|
|
334
|
+
asyncio.run(scenario())
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def test_f5_settings_picker_toggles_bool(tmp_path):
|
|
338
|
+
"""Regression: F5 crashed rendering the reasoning-effort row (None
|
|
339
|
+
value), and Enter on a bool row sent the literal token 'toggle',
|
|
340
|
+
which set_setting rejects — every toggle errored with 是开关."""
|
|
341
|
+
|
|
342
|
+
async def scenario():
|
|
343
|
+
app = _app(tmp_path, [])
|
|
344
|
+
async with app.run_test(size=(100, 30)) as pilot:
|
|
345
|
+
await pilot.press("f5")
|
|
346
|
+
await pilot.pause()
|
|
347
|
+
assert isinstance(app.screen, PickerModal)
|
|
348
|
+
keys = [p.get("key") for p, _ in app.screen.items]
|
|
349
|
+
assert keys[0] == "shell" # first bool row
|
|
350
|
+
assert app.cfg.shell is False
|
|
351
|
+
await pilot.press("enter") # toggle shell on
|
|
352
|
+
await pilot.pause()
|
|
353
|
+
assert app.cfg.shell is True
|
|
354
|
+
assert "shell:off → on" in _conv_text(app)
|
|
355
|
+
|
|
356
|
+
asyncio.run(scenario())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|