feat(voice): run pipeline eyes-free (STT -> Brain -> TTS), defer screen share

Make source/vision optional so the conversation loop runs with no screen
capture. Add Settings.voice() preset and `python -m wsai --voice` demo.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-08-11 00:05:02 +09:00
parent b0780988a2
commit 2b6059141e
6 changed files with 60 additions and 12 deletions

View File

@@ -35,6 +35,27 @@ def test_mock_pipeline_runs_and_replies(capsys):
assert "화면:" in replies[0]
def test_voice_only_pipeline_runs_without_eyes():
"""Eyes-free config (no source/vision) still runs STT -> Brain -> TTS."""
replies: list[str] = []
class CapturingTTS(MockTTS):
async def speak(self, reply):
replies.append(reply.text)
pipe = Pipeline(
brain=MockBrain(),
stt=MockSTT(script=["안녕", "잘 있어"], interval=0.05),
tts=CapturingTTS(),
)
asyncio.run(asyncio.wait_for(pipe.run(), timeout=5))
assert len(replies) == 2, "voice loop did not reply to every utterance"
# No eyes → the brain must report it has not seen a screen.
assert "아직 화면을 못 읽었어요" in replies[0]
def test_history_is_bounded():
pipe = Pipeline(
source=MockFrameSource(limit=0),