Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

fix: preserve WaveTone REPL JSON context

Shuhan Zhangc328407dd490
diff --git a/README.md b/README.md
index 808468c94..9871f028c 100644
--- a/README.md
+++ b/README.md
@@ -1228,7 +1228,7 @@ gimp 107 passed ✅ (64 unit + 43 e2e)
blender 208 passed ✅ (150 unit + 58 e2e)
inkscape 202 passed ✅ (148 unit + 54 e2e)
audacity 161 passed ✅ (107 unit + 54 e2e)
-wavetone 13 passed ✅ (8 unit + 5 e2e)
+wavetone 14 passed ✅ (9 unit + 5 e2e)
libreoffice 158 passed ✅ (89 unit + 69 e2e)
mubu 96 passed ✅ (85 unit + 11 e2e)
obs-studio 153 passed ✅ (116 unit + 37 e2e)
@@ -1308,7 +1308,7 @@ cli-anything/
├── 🧊 blender/agent-harness/ # Blender CLI (208 tests)
├── ✏️ inkscape/agent-harness/ # Inkscape CLI (202 tests)
├── 🎵 audacity/agent-harness/ # Audacity CLI (161 tests)
-├── wavetone/agent-harness/ # WaveTone CLI (13 tests: 8 unit + 5 e2e)
+├── wavetone/agent-harness/ # WaveTone CLI (14 tests: 9 unit + 5 e2e)
├── 🌐 browser/agent-harness/ # Browser CLI (DOMShell MCP, new)
├── 📄 libreoffice/agent-harness/ # LibreOffice CLI (158 tests)
├── 📧 mailchimp/agent-harness/ # Mailchimp Marketing API CLI (303 commands, 36 unit tests)
diff --git a/README_CN.md b/README_CN.md
index c8bc5712b..e39a06c41 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -679,7 +679,7 @@ gimp 107 passed ✅ (64 unit + 43 e2e)
blender 208 passed ✅ (150 unit + 58 e2e)
inkscape 202 passed ✅ (148 unit + 54 e2e)
audacity 161 passed ✅ (107 unit + 54 e2e)
-wavetone 13 passed ✅ (8 unit + 5 e2e)
+wavetone 14 passed ✅ (9 unit + 5 e2e)
libreoffice 158 passed ✅ (89 unit + 69 e2e)
obs-studio 153 passed ✅ (116 unit + 37 e2e)
kdenlive 155 passed ✅ (111 unit + 44 e2e)
@@ -753,7 +753,7 @@ cli-anything/
├── 🧊 blender/agent-harness/ # Blender CLI(208 项测试)
├── ✏️ inkscape/agent-harness/ # Inkscape CLI(202 项测试)
├── 🎵 audacity/agent-harness/ # Audacity CLI(161 项测试)
-├── wavetone/agent-harness/ # WaveTone CLI(13 项测试:8 unit + 5 e2e)
+├── wavetone/agent-harness/ # WaveTone CLI(14 项测试:9 unit + 5 e2e)
├── 📄 libreoffice/agent-harness/ # LibreOffice CLI(158 项测试)
├── 📚 zotero/agent-harness/ # Zotero CLI(新增,支持文献导入)
├── 📓 joplin/agent-harness/ # Joplin CLI(134 测试:107 单元 + 27 e2e)
diff --git a/wavetone/agent-harness/cli_anything/wavetone/tests/TEST.md b/wavetone/agent-harness/cli_anything/wavetone/tests/TEST.md
index 3ff121dff..ce1a02a44 100644
--- a/wavetone/agent-harness/cli_anything/wavetone/tests/TEST.md
+++ b/wavetone/agent-harness/cli_anything/wavetone/tests/TEST.md
@@ -17,7 +17,8 @@
- Probe a generated WAV file with the Python stdlib.
- Append and reload session events.
- Resolve `WAVETONE_EXE` from the environment.
-- Preserve inherited project context for REPL-style nested CLI invocations.
+- Preserve inherited project and JSON context for REPL-style nested CLI
+ invocations.
## E2E Test Plan
@@ -79,21 +80,21 @@ cli_anything/wavetone/tests/test_core.py::test_update_analysis_settings PASSED
cli_anything/wavetone/tests/test_core.py::test_probe_wav_metadata PASSED
cli_anything/wavetone/tests/test_core.py::test_session_event_log PASSED
cli_anything/wavetone/tests/test_core.py::test_find_wavetone_from_env PASSED
-cli_anything/wavetone/tests/test_core.py::test_cli_preserves_inherited_project_context PASSED
+cli_anything/wavetone/tests/test_core.py::test_cli_preserves_inherited_project_and_json_context PASSED
cli_anything/wavetone/tests/test_full_e2e.py::TestCLISubprocess::test_help PASSED
cli_anything/wavetone/tests/test_full_e2e.py::TestCLISubprocess::test_project_audio_workflow_json PASSED
cli_anything/wavetone/tests/test_full_e2e.py::TestCLISubprocess::test_formats_json PASSED
cli_anything/wavetone/tests/test_full_e2e.py::TestRealWaveToneBackend::test_doctor_real_backend PASSED
cli_anything/wavetone/tests/test_full_e2e.py::TestRealWaveToneBackend::test_launch_real_backend_with_wav PASSED
-14 passed in 3.53s
+14 passed in 3.46s
```
## Coverage Notes
- Unit tests cover manifest creation, validation, persistence, labels, tempo,
analysis settings, audio probing, session logs, backend discovery, and
- inherited CLI project context.
+ inherited CLI project and JSON context.
- CLI subprocess tests resolve and use the installed `cli-anything-wavetone`
entry point.
- Real backend coverage launches `C:\Users\Hp\Desktop\wavetone2.6.1\wavetone.exe`
diff --git a/wavetone/agent-harness/cli_anything/wavetone/tests/test_core.py b/wavetone/agent-harness/cli_anything/wavetone/tests/test_core.py
index 68ddcf013..75618b838 100644
--- a/wavetone/agent-harness/cli_anything/wavetone/tests/test_core.py
+++ b/wavetone/agent-harness/cli_anything/wavetone/tests/test_core.py
@@ -114,14 +114,14 @@ def test_find_wavetone_from_env(tmp_path: Path, monkeypatch: pytest.MonkeyPatch)
assert wavetone_backend.find_wavetone() == fake.resolve()
-def test_cli_preserves_inherited_project_context(tmp_path: Path) -> None:
+def test_cli_preserves_inherited_project_and_json_context(tmp_path: Path) -> None:
wav = make_wav(tmp_path / "tone.wav")
project_path = save_project(create_project(wav), tmp_path / "tone.wt.json")
result = CliRunner().invoke(
cli,
- ["--json", "audio", "probe"],
- obj={"project": str(project_path), "json": False},
+ ["audio", "probe"],
+ obj={"project": str(project_path), "json": True},
)
assert result.exit_code == 0, result.output
diff --git a/wavetone/agent-harness/cli_anything/wavetone/utils/repl_skin.py b/wavetone/agent-harness/cli_anything/wavetone/utils/repl_skin.py
index a1d4e27da..4e74c13c1 100644
--- a/wavetone/agent-harness/cli_anything/wavetone/utils/repl_skin.py
+++ b/wavetone/agent-harness/cli_anything/wavetone/utils/repl_skin.py
@@ -288,7 +288,6 @@ class ReplSkin:
Returns:
list of (style, text) tuples for prompt_toolkit.
"""
- accent_hex = _ANSI_256_TO_HEX.get(self.accent, "#5fafff")
tokens = []
tokens.append(("class:icon", "◆ "))
@@ -493,7 +492,6 @@ class ReplSkin:
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
- from prompt_toolkit.formatted_text import FormattedText
style = self.get_prompt_style()
diff --git a/wavetone/agent-harness/cli_anything/wavetone/wavetone_cli.py b/wavetone/agent-harness/cli_anything/wavetone/wavetone_cli.py
index a8f309506..a73de3755 100644
--- a/wavetone/agent-harness/cli_anything/wavetone/wavetone_cli.py
+++ b/wavetone/agent-harness/cli_anything/wavetone/wavetone_cli.py
@@ -67,7 +67,10 @@ def cli(ctx: click.Context, project_path: str | None, json_mode: bool) -> None:
ctx.obj["project"] = project_path
else:
ctx.obj.setdefault("project", None)
- ctx.obj["json"] = json_mode
+ if json_mode:
+ ctx.obj["json"] = True
+ else:
+ ctx.obj.setdefault("json", False)
if ctx.invoked_subcommand is None:
ctx.invoke(repl)