python-voiceio 1.18.5__tar.gz → 1.18.7__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.
- {python_voiceio-1.18.5/python_voiceio.egg-info → python_voiceio-1.18.7}/PKG-INFO +2 -2
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/README.md +1 -1
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/pyproject.toml +1 -1
- {python_voiceio-1.18.5 → python_voiceio-1.18.7/python_voiceio.egg-info}/PKG-INFO +2 -2
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/python_voiceio.egg-info/SOURCES.txt +7 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_config.py +4 -0
- python_voiceio-1.18.7/tests/test_learn_summary.py +173 -0
- python_voiceio-1.18.7/tests/test_replies.py +261 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_report.py +3 -2
- python_voiceio-1.18.7/tests/test_telemetry.py +223 -0
- python_voiceio-1.18.7/voiceio/__init__.py +1 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/app.py +2 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/__init__.py +3 -1
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/doctor.py +8 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/learn.py +10 -0
- python_voiceio-1.18.7/voiceio/cli/replies.py +18 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/config.py +10 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/catalog.py +12 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/evaluate.py +8 -1
- python_voiceio-1.18.7/voiceio/learn/summary.py +224 -0
- python_voiceio-1.18.7/voiceio/replies.py +231 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/report.py +12 -3
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/service.py +19 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/steps.py +6 -1
- python_voiceio-1.18.7/voiceio/telemetry.py +161 -0
- python_voiceio-1.18.5/voiceio/__init__.py +0 -1
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/LICENSE +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/python_voiceio.egg-info/dependency_links.txt +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/python_voiceio.egg-info/entry_points.txt +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/python_voiceio.egg-info/requires.txt +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/python_voiceio.egg-info/top_level.txt +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/setup.cfg +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_announce.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_app_wiring.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_audio_quality.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_audio_source.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_backend_probes.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_cancel.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_cli.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_clipboard_read.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_clipboard_typer.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_commands.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_concurrency_lockdown.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_context_terms.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_corrections.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_cuda_setup_hint.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_dead_mic.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_decoders.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_engine.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_errorlog.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_evdev_uaccess.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_evdev_x11_optional.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_fallback.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_fcitx_bridge.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_feedback_stream.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_focus.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_gpu_fallback.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_health.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_hints.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_history.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_hotkey_modes.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_engine_limits.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_engine_listener.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_pending.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_pids.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_ping.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_session.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_textlimit.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_ibus_typer.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_idle_audio.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_install_env.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_clean.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_import.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_language.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_metrics.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_pipeline.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_quiet.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_resume.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_review.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_learn_targets.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_llm.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_llm_api.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_mic_gain.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_modifier_guard.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_numbers.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_paste_last.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_pipeline.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_platform.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_postcorrect.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_postprocess.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_prebuffer.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_presence.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_prompt.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_quiet_audio.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_recorder_integration.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_retention.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_robustness.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_security_hardening.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_server.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_service.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_setup.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_sherpa.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_spool.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_streaming.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_suggest.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_tokens.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_transcriber.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_tray.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_tts.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_typer_manager.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_vad.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_vocabulary.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_wordfreq.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/tests/test_worker_decode.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/__main__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/announce.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/audio_source.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/backends.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/configcmd.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/corrections.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/history.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/models.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/servicecmd.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/uninstall.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/cli/vocab.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/clipboard_read.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/commands.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/consent.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/context_terms.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/bias.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/base.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/fetch.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/lanes.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/sherpa.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/decoders/whispercpp.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/engine.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/core/pipeline.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/corrections.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/data/60-voiceio-uaccess.rules +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/data/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/demo.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/display.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/errorlog.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/feedback.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/focus.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/health.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hints.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/history.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hotkeys/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hotkeys/base.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hotkeys/chain.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hotkeys/evdev.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hotkeys/pynput_backend.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/hotkeys/socket_backend.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ibus/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ibus/engine.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ibus/install.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ibus/pending.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ibus/session.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ibus/textlimit.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/idle_audio.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/install_env.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/augment.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/clean.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/importer.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/metrics.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/quiet.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/review.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/store.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/teacher.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/learn/train.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/llm.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/llm_api.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/mic_gain.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/models/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/models/silero_vad.onnx +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/numbers.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/pidlock.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/platform.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/postcorrect.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/postprocess.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/power.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/presence.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/privacy.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/prompt.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/quiet_audio.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/recorder.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/retention.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/server/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/server/__main__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/server/app.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/server/config.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/server/runtime.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/configfile.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/extras.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/hotkey.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/noninteractive.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/speech.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/system.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/setup/ui.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/sounds/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/sounds/alert.wav +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/sounds/commit.wav +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/sounds/start.wav +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/sounds/stop.wav +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/spool.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/streaming.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/suggest.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tokens.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tray/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tray/_icons.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tray/_indicator.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tray/_pystray.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/base.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/chain.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/edge_engine.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/espeak.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/piper_engine.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/player.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/tts/supertonic_engine.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/__init__.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/base.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/chain.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/clipboard.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/collecting.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/fcitx_bridge.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/ibus.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/manager.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/modifier_guard.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/paste.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/pynput_type.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/wtype.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/xdotool.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/typers/ydotool.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/ui.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/vad.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/vocab_stats.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/vocabulary.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/watchdog.py +0 -0
- {python_voiceio-1.18.5 → python_voiceio-1.18.7}/voiceio/wordfreq.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-voiceio
|
|
3
|
-
Version: 1.18.
|
|
3
|
+
Version: 1.18.7
|
|
4
4
|
Summary: Voice dictation for Linux. Speak → text, locally, instantly.
|
|
5
5
|
Author: Hugo Montenegro
|
|
6
6
|
License-Expression: MIT
|
|
@@ -65,7 +65,7 @@ Dynamic: license-file
|
|
|
65
65
|
**[Try it in your browser at voiceio.dev](https://voiceio.dev)**: no install, the model runs in the tab.
|
|
66
66
|
|
|
67
67
|
- **Types anywhere.** Press your hotkey, speak, and the words stream into the focused app with a live underlined preview (IBus), on Wayland and X11: GNOME, KDE, Hyprland, sway, i3.
|
|
68
|
-
- **Runs on your machine.** Whisper, or NVIDIA's Parakeet (text lands ~0.7 s after you stop talking instead of ~4.4 s, with every name you use as a hotword), decodes your speech locally. No account, no server, no telemetry; logs never contain your words.
|
|
68
|
+
- **Runs on your machine.** Whisper, or NVIDIA's Parakeet (text lands ~0.7 s after you stop talking instead of ~4.4 s, with every name you use as a hotword), decodes your speech locally. No account, no server, no telemetry unless you opt in to one anonymous weekly count; logs never contain your words.
|
|
69
69
|
- **Learns your words.** Keep your recordings (opt-in, on your disk) and voiceio fine-tunes its model on them while the machine is idle. It switches only when the new model wins on clips it never trained on. On the author's voice: 12.1% → 4.9% word errors after one night on a laptop CPU.
|
|
70
70
|
|
|
71
71
|
## Install
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
**[Try it in your browser at voiceio.dev](https://voiceio.dev)**: no install, the model runs in the tab.
|
|
13
13
|
|
|
14
14
|
- **Types anywhere.** Press your hotkey, speak, and the words stream into the focused app with a live underlined preview (IBus), on Wayland and X11: GNOME, KDE, Hyprland, sway, i3.
|
|
15
|
-
- **Runs on your machine.** Whisper, or NVIDIA's Parakeet (text lands ~0.7 s after you stop talking instead of ~4.4 s, with every name you use as a hotword), decodes your speech locally. No account, no server, no telemetry; logs never contain your words.
|
|
15
|
+
- **Runs on your machine.** Whisper, or NVIDIA's Parakeet (text lands ~0.7 s after you stop talking instead of ~4.4 s, with every name you use as a hotword), decodes your speech locally. No account, no server, no telemetry unless you opt in to one anonymous weekly count; logs never contain your words.
|
|
16
16
|
- **Learns your words.** Keep your recordings (opt-in, on your disk) and voiceio fine-tunes its model on them while the machine is idle. It switches only when the new model wins on clips it never trained on. On the author's voice: 12.1% → 4.9% word errors after one night on a laptop CPU.
|
|
17
17
|
|
|
18
18
|
## Install
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-voiceio
|
|
3
|
-
Version: 1.18.
|
|
3
|
+
Version: 1.18.7
|
|
4
4
|
Summary: Voice dictation for Linux. Speak → text, locally, instantly.
|
|
5
5
|
Author: Hugo Montenegro
|
|
6
6
|
License-Expression: MIT
|
|
@@ -65,7 +65,7 @@ Dynamic: license-file
|
|
|
65
65
|
**[Try it in your browser at voiceio.dev](https://voiceio.dev)**: no install, the model runs in the tab.
|
|
66
66
|
|
|
67
67
|
- **Types anywhere.** Press your hotkey, speak, and the words stream into the focused app with a live underlined preview (IBus), on Wayland and X11: GNOME, KDE, Hyprland, sway, i3.
|
|
68
|
-
- **Runs on your machine.** Whisper, or NVIDIA's Parakeet (text lands ~0.7 s after you stop talking instead of ~4.4 s, with every name you use as a hotword), decodes your speech locally. No account, no server, no telemetry; logs never contain your words.
|
|
68
|
+
- **Runs on your machine.** Whisper, or NVIDIA's Parakeet (text lands ~0.7 s after you stop talking instead of ~4.4 s, with every name you use as a hotword), decodes your speech locally. No account, no server, no telemetry unless you opt in to one anonymous weekly count; logs never contain your words.
|
|
69
69
|
- **Learns your words.** Keep your recordings (opt-in, on your disk) and voiceio fine-tunes its model on them while the machine is idle. It switches only when the new model wins on clips it never trained on. On the author's voice: 12.1% → 4.9% word errors after one night on a laptop CPU.
|
|
70
70
|
|
|
71
71
|
## Install
|
|
@@ -55,6 +55,7 @@ tests/test_learn_pipeline.py
|
|
|
55
55
|
tests/test_learn_quiet.py
|
|
56
56
|
tests/test_learn_resume.py
|
|
57
57
|
tests/test_learn_review.py
|
|
58
|
+
tests/test_learn_summary.py
|
|
58
59
|
tests/test_learn_targets.py
|
|
59
60
|
tests/test_llm.py
|
|
60
61
|
tests/test_llm_api.py
|
|
@@ -71,6 +72,7 @@ tests/test_presence.py
|
|
|
71
72
|
tests/test_prompt.py
|
|
72
73
|
tests/test_quiet_audio.py
|
|
73
74
|
tests/test_recorder_integration.py
|
|
75
|
+
tests/test_replies.py
|
|
74
76
|
tests/test_report.py
|
|
75
77
|
tests/test_retention.py
|
|
76
78
|
tests/test_robustness.py
|
|
@@ -82,6 +84,7 @@ tests/test_sherpa.py
|
|
|
82
84
|
tests/test_spool.py
|
|
83
85
|
tests/test_streaming.py
|
|
84
86
|
tests/test_suggest.py
|
|
87
|
+
tests/test_telemetry.py
|
|
85
88
|
tests/test_tokens.py
|
|
86
89
|
tests/test_transcriber.py
|
|
87
90
|
tests/test_tray.py
|
|
@@ -127,12 +130,14 @@ voiceio/privacy.py
|
|
|
127
130
|
voiceio/prompt.py
|
|
128
131
|
voiceio/quiet_audio.py
|
|
129
132
|
voiceio/recorder.py
|
|
133
|
+
voiceio/replies.py
|
|
130
134
|
voiceio/report.py
|
|
131
135
|
voiceio/retention.py
|
|
132
136
|
voiceio/service.py
|
|
133
137
|
voiceio/spool.py
|
|
134
138
|
voiceio/streaming.py
|
|
135
139
|
voiceio/suggest.py
|
|
140
|
+
voiceio/telemetry.py
|
|
136
141
|
voiceio/tokens.py
|
|
137
142
|
voiceio/ui.py
|
|
138
143
|
voiceio/vad.py
|
|
@@ -147,6 +152,7 @@ voiceio/cli/doctor.py
|
|
|
147
152
|
voiceio/cli/history.py
|
|
148
153
|
voiceio/cli/learn.py
|
|
149
154
|
voiceio/cli/models.py
|
|
155
|
+
voiceio/cli/replies.py
|
|
150
156
|
voiceio/cli/servicecmd.py
|
|
151
157
|
voiceio/cli/uninstall.py
|
|
152
158
|
voiceio/cli/vocab.py
|
|
@@ -186,6 +192,7 @@ voiceio/learn/metrics.py
|
|
|
186
192
|
voiceio/learn/quiet.py
|
|
187
193
|
voiceio/learn/review.py
|
|
188
194
|
voiceio/learn/store.py
|
|
195
|
+
voiceio/learn/summary.py
|
|
189
196
|
voiceio/learn/teacher.py
|
|
190
197
|
voiceio/learn/train.py
|
|
191
198
|
voiceio/models/__init__.py
|
|
@@ -106,6 +106,10 @@ def test_example_config_matches_defaults():
|
|
|
106
106
|
defaults = getattr(cfg, sec.name)
|
|
107
107
|
assert sec.name in example, f"[{sec.name}] missing from example"
|
|
108
108
|
for f in dataclasses.fields(defaults):
|
|
109
|
+
if (sec.name, f.name) == ("telemetry", "ping"):
|
|
110
|
+
# Unset (never asked) has no TOML spelling: documented commented out.
|
|
111
|
+
assert defaults.ping is None and "ping" not in example["telemetry"]
|
|
112
|
+
continue
|
|
109
113
|
assert f.name in example[sec.name], f"{sec.name}.{f.name} missing"
|
|
110
114
|
if (sec.name, f.name) == ("model", "name"):
|
|
111
115
|
# "auto" resolves to the default decoder on construction
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"""`voiceio learn report`: numbers only, never words or paths."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import argparse
|
|
5
|
+
import datetime as dt
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
from voiceio import config, history, service
|
|
12
|
+
from voiceio.learn import metrics, summary
|
|
13
|
+
from voiceio.learn.store import learn_dir
|
|
14
|
+
|
|
15
|
+
NOW = dt.datetime(2026, 11, 19, 12, 0, 0).timestamp()
|
|
16
|
+
DAY = 86400
|
|
17
|
+
SECRETS = ("Kalshi", "HyperNEAT", "zorblax", "secret-plan.txt", "alice")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _stamp(ts: float) -> str:
|
|
21
|
+
return dt.datetime.fromtimestamp(ts).strftime("%Y-%m-%d %H:%M:%S,000")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@pytest.fixture
|
|
25
|
+
def seeded(tmp_path, monkeypatch):
|
|
26
|
+
"""A week of use whose every store holds words and paths."""
|
|
27
|
+
home = os.path.expanduser("~")
|
|
28
|
+
run = learn_dir() / "models" / "v0002-small-20261115-0300"
|
|
29
|
+
model = str(run / "ct2")
|
|
30
|
+
(run / "ct2").mkdir(parents=True)
|
|
31
|
+
|
|
32
|
+
history.HISTORY_PATH.parent.mkdir(parents=True, exist_ok=True)
|
|
33
|
+
rows = [
|
|
34
|
+
{"ts": NOW - 1 * DAY, "text": "Kalshi zorblax HyperNEAT", "raw": "kalchi zorblax",
|
|
35
|
+
"duration": 90.0, "context": f"{home}/secret-plan.txt - alice"},
|
|
36
|
+
{"ts": NOW - 3 * DAY, "text": "zorblax again", "duration": 30.0,
|
|
37
|
+
"audio": f"{home}/.local/state/voiceio/recordings/zorblax.wav"},
|
|
38
|
+
{"ts": NOW - 9 * DAY, "text": "too old", "duration": 600.0},
|
|
39
|
+
]
|
|
40
|
+
history.HISTORY_PATH.write_text("".join(json.dumps(r) + "\n" for r in rows))
|
|
41
|
+
|
|
42
|
+
ds = learn_dir() / "datasets" / "v0002"
|
|
43
|
+
ds.mkdir(parents=True)
|
|
44
|
+
runs = learn_dir() / "runs"
|
|
45
|
+
runs.mkdir()
|
|
46
|
+
(runs / "eval-20261115-031500.json").write_text(json.dumps({
|
|
47
|
+
"decoder": f"faster-whisper:{model}", "dataset": "v0002", "mode": "offline",
|
|
48
|
+
"metrics": metrics.METRICS_VERSION, "wer": 0.0612, "term_recall": 0.794,
|
|
49
|
+
"clips": 84, "per_clip": [{"audio": f"{home}/zorblax.wav", "ref": "Kalshi zorblax",
|
|
50
|
+
"hyp": "kalchi zorblax"}],
|
|
51
|
+
}))
|
|
52
|
+
(learn_dir() / "labels.jsonl").write_text("".join(json.dumps({
|
|
53
|
+
"audio": f"rec-{i}.wav", "source": "teacher:large-v3-turbo", "ts": ts,
|
|
54
|
+
"segments": [{"start": 0.0, "end": 2.0, "text": "HyperNEAT zorblax"}],
|
|
55
|
+
}) + "\n" for i, ts in enumerate((NOW - DAY, NOW - 2 * DAY, NOW - 20 * DAY))))
|
|
56
|
+
|
|
57
|
+
log = tmp_path / "voiceio.log"
|
|
58
|
+
log.write_text("\n".join([
|
|
59
|
+
f"{_stamp(NOW - 20 * DAY)} voiceio.streaming ERROR Final transcribe/apply error",
|
|
60
|
+
f"{_stamp(NOW - 2 * DAY)} voiceio.typers.manager WARNING Typer 'ibus' failed: zorblax, trying fallback",
|
|
61
|
+
f"{_stamp(NOW - 2 * DAY)} voiceio.typers.manager INFO Switched to typer: clipboard",
|
|
62
|
+
f"{_stamp(NOW - DAY)} voiceio.streaming ERROR Final transcribe/apply error",
|
|
63
|
+
"Traceback (most recent call last):",
|
|
64
|
+
f' File "{home}/voiceio/streaming.py", line 280, in _final',
|
|
65
|
+
"ValueError: Kalshi zorblax",
|
|
66
|
+
f"{_stamp(NOW - DAY)} voiceio.app ERROR Processing failed",
|
|
67
|
+
f"{_stamp(NOW - DAY)} voiceio.tray ERROR Tray icon failed: alice",
|
|
68
|
+
]) + "\n")
|
|
69
|
+
|
|
70
|
+
monkeypatch.setattr(service, "has_systemd", lambda: True)
|
|
71
|
+
monkeypatch.setattr(service, "learn_timer_enabled", lambda: True)
|
|
72
|
+
monkeypatch.setattr(service, "learn_last_run", lambda: (NOW - 2 * DAY, "success"))
|
|
73
|
+
cfg = config.Config()
|
|
74
|
+
cfg.model.name = model
|
|
75
|
+
return cfg, [log]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_report_counts_the_week(seeded):
|
|
79
|
+
cfg, logs = seeded
|
|
80
|
+
out = summary.build(NOW, cfg, log_paths=logs)
|
|
81
|
+
from voiceio import __version__
|
|
82
|
+
assert out == {
|
|
83
|
+
"schema": 1, "date": "2026-11-19", "window_days": 7, "version": __version__,
|
|
84
|
+
"model_family": "whisper", "model_name": "fine-tune v0002-small-20261115-0300",
|
|
85
|
+
"dictations_7d": 2, "audio_minutes_7d": 2.0,
|
|
86
|
+
"wer": 0.0612, "vocab_recall": 0.794, "eval_dataset": "v0002", "eval_clips": 84,
|
|
87
|
+
"eval_date": "2026-11-15",
|
|
88
|
+
"clipboard_fallbacks_7d": 1, "decoder_errors_7d": 2, "log_days_covered": 7,
|
|
89
|
+
"clips_labelled_7d": 2, "learn_scheduled": True, "learn_ran_7d": True,
|
|
90
|
+
"learn_last_run": "2026-11-17", "learn_last_result": "success",
|
|
91
|
+
"unavailable": {},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _strings(value):
|
|
96
|
+
if isinstance(value, dict):
|
|
97
|
+
for k, v in value.items():
|
|
98
|
+
yield k
|
|
99
|
+
yield from _strings(v)
|
|
100
|
+
elif isinstance(value, str):
|
|
101
|
+
yield value
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def test_no_words_or_paths_ever_leave(seeded):
|
|
105
|
+
cfg, logs = seeded
|
|
106
|
+
out = summary.build(NOW, cfg, log_paths=logs)
|
|
107
|
+
text = summary.to_json(out) + summary.format_text(out)
|
|
108
|
+
for secret in (*SECRETS, os.path.expanduser("~"), str(learn_dir()), "ct2", ".wav"):
|
|
109
|
+
assert secret not in text
|
|
110
|
+
assert not [s for s in _strings(out) if "/" in s]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def test_missing_data_is_null_with_a_reason(monkeypatch, tmp_path):
|
|
114
|
+
monkeypatch.setattr(service, "has_systemd", lambda: False)
|
|
115
|
+
cfg = config.Config()
|
|
116
|
+
cfg.model.name = "parakeet-tdt-0.6b-v2"
|
|
117
|
+
out = summary.build(NOW, cfg, log_paths=[tmp_path / "missing.log"])
|
|
118
|
+
assert out["model_family"] == "parakeet" and out["model_name"] == "parakeet-tdt-0.6b-v2"
|
|
119
|
+
for key in ("dictations_7d", "audio_minutes_7d", "wer", "clipboard_fallbacks_7d",
|
|
120
|
+
"decoder_errors_7d", "learn_scheduled", "learn_ran_7d"):
|
|
121
|
+
assert out[key] is None
|
|
122
|
+
assert out["unavailable"][key]
|
|
123
|
+
assert out["clips_labelled_7d"] == 0
|
|
124
|
+
assert "n/a — no dataset yet" in summary.format_text(out)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def test_eval_of_another_model_is_not_reported(seeded):
|
|
128
|
+
cfg, logs = seeded
|
|
129
|
+
cfg.model.name = "small"
|
|
130
|
+
out = summary.build(NOW, cfg, log_paths=logs)
|
|
131
|
+
assert out["wer"] is None
|
|
132
|
+
assert out["unavailable"]["wer"].startswith("no stored eval of the active model")
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@pytest.mark.parametrize("name,label", [
|
|
136
|
+
("small", "small"),
|
|
137
|
+
("whispercpp:http://10.1.2.3:8080", "whisper.cpp server"),
|
|
138
|
+
("sherpa:/home/alice/models/my-parakeet", "local my-parakeet"),
|
|
139
|
+
("/opt/models/alice-tuned/ct2", "local ct2"),
|
|
140
|
+
])
|
|
141
|
+
def test_model_label_is_never_a_path(name, label, monkeypatch):
|
|
142
|
+
from voiceio import report
|
|
143
|
+
monkeypatch.setattr(report, "_identities", lambda: [("alice", "<user>")])
|
|
144
|
+
assert summary.model_label(name) == label.replace("alice", "<user>")
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def test_cli_prints_json_and_text(seeded, capsys, monkeypatch):
|
|
148
|
+
from voiceio.cli import learn as learn_cli
|
|
149
|
+
cfg, logs = seeded
|
|
150
|
+
monkeypatch.setattr(config, "load", lambda *a, **k: cfg)
|
|
151
|
+
monkeypatch.setattr(summary, "_log_paths", lambda: logs)
|
|
152
|
+
learn_cli.cmd_report(argparse.Namespace(json=True))
|
|
153
|
+
out = json.loads(capsys.readouterr().out)
|
|
154
|
+
assert out["model_family"] == "whisper"
|
|
155
|
+
learn_cli.cmd_report(argparse.Namespace(json=False))
|
|
156
|
+
text = capsys.readouterr().out
|
|
157
|
+
assert "decoder errors" in text and "zorblax" not in text
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def test_learn_last_run_parses_systemctl(monkeypatch):
|
|
161
|
+
import subprocess
|
|
162
|
+
|
|
163
|
+
def fake(argv, **kw):
|
|
164
|
+
prop = argv[argv.index("-p") + 1]
|
|
165
|
+
out = {"LastTriggerUSec": "@1763260212\n", "Result": "success\n"}[prop]
|
|
166
|
+
return subprocess.CompletedProcess(argv, 0, stdout=out)
|
|
167
|
+
|
|
168
|
+
monkeypatch.setattr(service.subprocess, "run", fake)
|
|
169
|
+
assert service.learn_last_run() == (1763260212.0, "success")
|
|
170
|
+
|
|
171
|
+
monkeypatch.setattr(service.subprocess, "run",
|
|
172
|
+
lambda argv, **kw: subprocess.CompletedProcess(argv, 0, stdout="n/a\n"))
|
|
173
|
+
assert service.learn_last_run() == (None, "")
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"""`voiceio replies` and doctor's nudge: saved receipts, parsing, offline."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import io
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
from voiceio import replies, report
|
|
10
|
+
|
|
11
|
+
DAY = 86400
|
|
12
|
+
NOW = 1_800_000_000.0
|
|
13
|
+
MINE = "a" * 32
|
|
14
|
+
OTHER_KEY = "10d3d7e7" + "0" * 56
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class _Resp(io.BytesIO):
|
|
18
|
+
def __enter__(self):
|
|
19
|
+
return self
|
|
20
|
+
|
|
21
|
+
def __exit__(self, *a):
|
|
22
|
+
return False
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _msg(id, author, created, text="hi", reply_to=MINE, **kw):
|
|
26
|
+
m = {"id": id, "author": author, "created_at": created, "text": text,
|
|
27
|
+
"hidden": False, "reply_to": reply_to}
|
|
28
|
+
m.update(kw)
|
|
29
|
+
return m
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _thread(*msgs, root_at=NOW - DAY):
|
|
33
|
+
root = {"id": MINE, "author": "anonymous", "created_at": root_at,
|
|
34
|
+
"text": "voiceio 1.18.5 report", "hidden": False}
|
|
35
|
+
return {"ok": True, "messages": [root, *msgs]}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@pytest.fixture
|
|
39
|
+
def board(monkeypatch):
|
|
40
|
+
"""Serve threads by id; records the URLs and timeouts asked for."""
|
|
41
|
+
threads: dict[str, dict] = {}
|
|
42
|
+
calls: list[tuple[str, float]] = []
|
|
43
|
+
|
|
44
|
+
def fake(url, *, timeout):
|
|
45
|
+
calls.append((url, timeout))
|
|
46
|
+
rid = url.removeprefix(replies.THREAD_API).split("?")[0]
|
|
47
|
+
if rid not in threads:
|
|
48
|
+
raise ConnectionRefusedError("offline")
|
|
49
|
+
return _Resp(json.dumps(threads[rid]).encode())
|
|
50
|
+
|
|
51
|
+
monkeypatch.setattr(report, "_urlopen", fake)
|
|
52
|
+
return threads, calls
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# ── save / prune ──
|
|
56
|
+
|
|
57
|
+
def test_remember_saves_id_and_time_only():
|
|
58
|
+
replies.remember(MINE, now=NOW)
|
|
59
|
+
raw = json.loads(replies._path().read_text())
|
|
60
|
+
assert raw == {"reports": [{"id": MINE, "posted_at": NOW, "read_until": 0.0}]}
|
|
61
|
+
assert replies._path().stat().st_mode & 0o077 == 0
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_prune_keeps_twenty_newest_and_drops_old():
|
|
65
|
+
for i in range(25):
|
|
66
|
+
replies.remember(f"r{i:02d}", now=NOW - 30 * DAY + i)
|
|
67
|
+
replies.remember("old", now=NOW - 61 * DAY)
|
|
68
|
+
kept = replies.saved(now=NOW)
|
|
69
|
+
assert len(kept) == replies.MAX_SAVED
|
|
70
|
+
assert kept[0]["id"] == "r24" and kept[-1]["id"] == "r05"
|
|
71
|
+
assert "old" not in {r["id"] for r in kept}
|
|
72
|
+
assert replies.saved(now=NOW + 31 * DAY) == []
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def test_remember_ignores_bad_ids_and_bad_files():
|
|
76
|
+
replies._path().write_text("not json")
|
|
77
|
+
assert replies.saved() == []
|
|
78
|
+
replies.remember("../etc/passwd")
|
|
79
|
+
assert replies.saved() == []
|
|
80
|
+
replies.remember(MINE)
|
|
81
|
+
assert [r["id"] for r in replies.saved()] == [MINE]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_remember_never_raises(monkeypatch):
|
|
85
|
+
monkeypatch.setattr(replies, "_save", lambda r: 1 / 0)
|
|
86
|
+
replies.remember(MINE)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_share_remembers_the_receipt(monkeypatch, capsys):
|
|
90
|
+
monkeypatch.setattr(report, "post", lambda text: (True, MINE))
|
|
91
|
+
monkeypatch.setattr(report, "_interactive", lambda: False)
|
|
92
|
+
assert report.share("r", yes=True) is True
|
|
93
|
+
assert [r["id"] for r in replies.saved()] == [MINE]
|
|
94
|
+
out = capsys.readouterr().out
|
|
95
|
+
assert f"https://swarmmemo.com/e/{MINE}" in out and "voiceio replies" in out
|
|
96
|
+
assert "within a day" in out
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def test_failed_post_remembers_nothing(monkeypatch):
|
|
100
|
+
monkeypatch.setattr(report, "post", lambda text: (False, "offline"))
|
|
101
|
+
report.share("r", yes=True)
|
|
102
|
+
assert replies.saved() == []
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# ── parsing ──
|
|
106
|
+
|
|
107
|
+
def test_parse_labels_maintainer_by_key_not_handle():
|
|
108
|
+
body = _thread(
|
|
109
|
+
_msg("m1", replies.MAINTAINER_KEY, NOW - 100, author_handle="voiceio"),
|
|
110
|
+
_msg("f1", OTHER_KEY, NOW - 50, author_handle="voiceio"), # a lookalike
|
|
111
|
+
_msg("x1", "anonymous", NOW - 10),
|
|
112
|
+
)
|
|
113
|
+
got = replies.parse_thread(body, MINE)
|
|
114
|
+
assert [(r.id, r.label) for r in got] == [
|
|
115
|
+
("m1", "voiceio maintainer"), ("f1", "reply"), ("x1", "reply")]
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def test_parse_skips_own_post_and_hidden_and_sorts():
|
|
119
|
+
body = _thread(_msg("b", "anonymous", NOW - 1), _msg("a", "anonymous", NOW - 9),
|
|
120
|
+
_msg("h", replies.MAINTAINER_KEY, NOW - 5, hidden=True))
|
|
121
|
+
assert [r.id for r in replies.parse_thread(body, MINE)] == ["a", "b"]
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def test_parse_strips_escapes_and_control_chars():
|
|
125
|
+
evil = "ok\x1b[2J\x1b]0;pwned\x07 \x1b[31mred\x1b[0m\r\nline2\x00\x9b"
|
|
126
|
+
[r] = replies.parse_thread(_thread(_msg("e", "anonymous", NOW, evil)), MINE)
|
|
127
|
+
assert "\x1b" not in r.text and "\x07" not in r.text and "\x00" not in r.text
|
|
128
|
+
assert "\x9b" not in r.text and "\r" not in r.text
|
|
129
|
+
assert r.text.startswith("ok") and "red" in r.text and r.text.endswith("line2")
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@pytest.mark.parametrize("body", [[], {"ok": False}, {"ok": True}, {"ok": True, "messages": 3}])
|
|
133
|
+
def test_parse_rejects_non_threads(body):
|
|
134
|
+
with pytest.raises(ValueError):
|
|
135
|
+
replies.parse_thread(body, MINE)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def test_new_is_relative_to_read_until():
|
|
139
|
+
body = _thread(_msg("old", "anonymous", NOW - 100), _msg("new", "anonymous", NOW - 1))
|
|
140
|
+
got = replies.parse_thread(body, MINE, read_until=NOW - 50)
|
|
141
|
+
assert [(r.id, r.new) for r in got] == [("old", False), ("new", True)]
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# ── voiceio replies ──
|
|
145
|
+
|
|
146
|
+
def test_show_without_reports_says_how_to_file(capsys, board):
|
|
147
|
+
assert replies.show() == 0
|
|
148
|
+
out = capsys.readouterr().out
|
|
149
|
+
assert "voiceio doctor --report" in out
|
|
150
|
+
assert board[1] == []
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_show_prints_marks_new_and_then_not(capsys, board):
|
|
154
|
+
threads, calls = board
|
|
155
|
+
replies.remember(MINE)
|
|
156
|
+
threads[MINE] = _thread(_msg("m1", replies.MAINTAINER_KEY, NOW, "Try xdotool."))
|
|
157
|
+
assert replies.show() == 0
|
|
158
|
+
out = capsys.readouterr().out
|
|
159
|
+
assert "voiceio maintainer" in out and "[new]" in out and "Try xdotool." in out
|
|
160
|
+
assert calls[0][1] <= 5
|
|
161
|
+
assert replies.show() == 0
|
|
162
|
+
assert "[new]" not in capsys.readouterr().out
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def test_show_newest_report_first_and_one_offline(capsys, board):
|
|
166
|
+
threads, _ = board
|
|
167
|
+
replies.remember("older", now=NOW - 5 * DAY)
|
|
168
|
+
replies.remember(MINE, now=NOW - DAY)
|
|
169
|
+
threads[MINE] = _thread()
|
|
170
|
+
assert replies.show() == 0
|
|
171
|
+
out = capsys.readouterr().out
|
|
172
|
+
assert out.index(MINE) < out.index("older")
|
|
173
|
+
assert "No replies yet" in out and "Could not load the replies" in out
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def test_show_offline_is_a_clear_message(capsys):
|
|
177
|
+
# conftest refuses every connection.
|
|
178
|
+
replies.remember(MINE)
|
|
179
|
+
assert replies.show() == 1
|
|
180
|
+
out = capsys.readouterr().out
|
|
181
|
+
assert "offline" in out and f"https://swarmmemo.com/e/{MINE}" in out
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def test_show_failure_does_not_mark_read(capsys, board):
|
|
185
|
+
threads, _ = board
|
|
186
|
+
replies.remember(MINE)
|
|
187
|
+
replies.show() # offline for this id
|
|
188
|
+
threads[MINE] = _thread(_msg("m1", replies.MAINTAINER_KEY, NOW))
|
|
189
|
+
replies.show()
|
|
190
|
+
assert "[new]" in capsys.readouterr().out
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
# ── doctor's nudge ──
|
|
194
|
+
|
|
195
|
+
def test_nudge_when_maintainer_answered_since_last_read(board):
|
|
196
|
+
threads, calls = board
|
|
197
|
+
replies.remember(MINE)
|
|
198
|
+
threads[MINE] = _thread(_msg("m1", replies.MAINTAINER_KEY, NOW))
|
|
199
|
+
assert "voiceio replies" in replies.nudge()
|
|
200
|
+
assert len(calls) == 1 and calls[0][1] <= 2
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def test_nudge_quiet_after_reading(board, capsys):
|
|
204
|
+
threads, _ = board
|
|
205
|
+
replies.remember(MINE)
|
|
206
|
+
threads[MINE] = _thread(_msg("m1", replies.MAINTAINER_KEY, NOW))
|
|
207
|
+
replies.show()
|
|
208
|
+
assert replies.nudge() == ""
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def test_nudge_ignores_non_maintainer_replies(board):
|
|
212
|
+
threads, _ = board
|
|
213
|
+
replies.remember(MINE)
|
|
214
|
+
threads[MINE] = _thread(_msg("x", OTHER_KEY, NOW))
|
|
215
|
+
assert replies.nudge() == ""
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def test_nudge_makes_no_request_without_recent_reports(board):
|
|
219
|
+
_, calls = board
|
|
220
|
+
assert replies.nudge() == ""
|
|
221
|
+
replies.remember(MINE, now=replies.time.time() - 40 * DAY)
|
|
222
|
+
assert replies.nudge() == ""
|
|
223
|
+
assert calls == []
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def test_nudge_only_asks_about_the_newest_report(board):
|
|
227
|
+
threads, calls = board
|
|
228
|
+
replies.remember("older", now=replies.time.time() - 3 * DAY)
|
|
229
|
+
replies.remember(MINE)
|
|
230
|
+
threads[MINE] = _thread()
|
|
231
|
+
replies.nudge()
|
|
232
|
+
assert len(calls) == 1 and MINE in calls[0][0]
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def test_nudge_offline_is_silent():
|
|
236
|
+
replies.remember(MINE)
|
|
237
|
+
assert replies.nudge() == ""
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def test_replies_subcommand_is_registered(monkeypatch, capsys):
|
|
241
|
+
import sys
|
|
242
|
+
|
|
243
|
+
from voiceio.cli import main
|
|
244
|
+
monkeypatch.setattr(sys, "argv", ["voiceio", "replies"])
|
|
245
|
+
with pytest.raises(SystemExit) as e:
|
|
246
|
+
main()
|
|
247
|
+
assert e.value.code == 0
|
|
248
|
+
assert "voiceio doctor --report" in capsys.readouterr().out
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def test_parse_keeps_only_answers_below_the_report():
|
|
252
|
+
"""The API returns the conversation from its first post; a report that was
|
|
253
|
+
itself a reply must not list its ancestors or side branches."""
|
|
254
|
+
body = {"ok": True, "messages": [
|
|
255
|
+
_msg("root", "anonymous", NOW - 9, reply_to=None),
|
|
256
|
+
_msg(MINE, "anonymous", NOW - 8, reply_to="root"),
|
|
257
|
+
_msg("side", replies.MAINTAINER_KEY, NOW - 7, reply_to="root"),
|
|
258
|
+
_msg("ans", replies.MAINTAINER_KEY, NOW - 6, reply_to=MINE),
|
|
259
|
+
_msg("deep", OTHER_KEY, NOW - 5, reply_to="ans"),
|
|
260
|
+
]}
|
|
261
|
+
assert [r.id for r in replies.parse_thread(body, MINE)] == ["ans", "deep"]
|
|
@@ -231,7 +231,8 @@ def test_share_asks_and_posts_on_yes(monkeypatch, capsys, posted):
|
|
|
231
231
|
monkeypatch.setattr("builtins.input", lambda prompt: "y")
|
|
232
232
|
assert report.share("the report") is True
|
|
233
233
|
out = capsys.readouterr().out
|
|
234
|
-
assert "PUBLICLY" in out and "the report" in out
|
|
234
|
+
assert "PUBLICLY" in out and "the report" in out
|
|
235
|
+
assert "https://swarmmemo.com/e/r1" in out and "voiceio replies" in out
|
|
235
236
|
assert posted == ["the report"]
|
|
236
237
|
|
|
237
238
|
|
|
@@ -303,7 +304,7 @@ def test_doctor_report_yes_posts_scrubbed_comment(monkeypatch, capsys, doctor_en
|
|
|
303
304
|
_assert_private(posted[0])
|
|
304
305
|
_assert_private(out)
|
|
305
306
|
assert "comment: worked, <user> here" in posted[0]
|
|
306
|
-
assert
|
|
307
|
+
assert "https://swarmmemo.com/e/r1" in out
|
|
307
308
|
|
|
308
309
|
|
|
309
310
|
def test_doctor_report_without_tty_or_yes_does_not_post(monkeypatch, capsys, doctor_env, posted):
|