python-voiceio 1.18.5__tar.gz → 1.18.6__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.
Files changed (243) hide show
  1. {python_voiceio-1.18.5/python_voiceio.egg-info → python_voiceio-1.18.6}/PKG-INFO +1 -1
  2. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/pyproject.toml +1 -1
  3. {python_voiceio-1.18.5 → python_voiceio-1.18.6/python_voiceio.egg-info}/PKG-INFO +1 -1
  4. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/python_voiceio.egg-info/SOURCES.txt +3 -0
  5. python_voiceio-1.18.6/tests/test_replies.py +261 -0
  6. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_report.py +3 -2
  7. python_voiceio-1.18.6/voiceio/__init__.py +1 -0
  8. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/__init__.py +3 -1
  9. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/doctor.py +3 -0
  10. python_voiceio-1.18.6/voiceio/cli/replies.py +18 -0
  11. python_voiceio-1.18.6/voiceio/replies.py +231 -0
  12. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/report.py +5 -1
  13. python_voiceio-1.18.5/voiceio/__init__.py +0 -1
  14. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/LICENSE +0 -0
  15. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/README.md +0 -0
  16. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/python_voiceio.egg-info/dependency_links.txt +0 -0
  17. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/python_voiceio.egg-info/entry_points.txt +0 -0
  18. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/python_voiceio.egg-info/requires.txt +0 -0
  19. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/python_voiceio.egg-info/top_level.txt +0 -0
  20. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/setup.cfg +0 -0
  21. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_announce.py +0 -0
  22. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_app_wiring.py +0 -0
  23. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_audio_quality.py +0 -0
  24. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_audio_source.py +0 -0
  25. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_backend_probes.py +0 -0
  26. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_cancel.py +0 -0
  27. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_cli.py +0 -0
  28. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_clipboard_read.py +0 -0
  29. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_clipboard_typer.py +0 -0
  30. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_commands.py +0 -0
  31. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_concurrency_lockdown.py +0 -0
  32. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_config.py +0 -0
  33. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_context_terms.py +0 -0
  34. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_corrections.py +0 -0
  35. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_cuda_setup_hint.py +0 -0
  36. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_dead_mic.py +0 -0
  37. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_decoders.py +0 -0
  38. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_engine.py +0 -0
  39. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_errorlog.py +0 -0
  40. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_evdev_uaccess.py +0 -0
  41. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_evdev_x11_optional.py +0 -0
  42. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_fallback.py +0 -0
  43. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_fcitx_bridge.py +0 -0
  44. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_feedback_stream.py +0 -0
  45. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_focus.py +0 -0
  46. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_gpu_fallback.py +0 -0
  47. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_health.py +0 -0
  48. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_hints.py +0 -0
  49. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_history.py +0 -0
  50. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_hotkey_modes.py +0 -0
  51. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_engine_limits.py +0 -0
  52. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_engine_listener.py +0 -0
  53. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_pending.py +0 -0
  54. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_pids.py +0 -0
  55. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_ping.py +0 -0
  56. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_session.py +0 -0
  57. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_textlimit.py +0 -0
  58. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_ibus_typer.py +0 -0
  59. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_idle_audio.py +0 -0
  60. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_install_env.py +0 -0
  61. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_clean.py +0 -0
  62. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_import.py +0 -0
  63. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_language.py +0 -0
  64. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_metrics.py +0 -0
  65. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_pipeline.py +0 -0
  66. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_quiet.py +0 -0
  67. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_resume.py +0 -0
  68. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_review.py +0 -0
  69. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_learn_targets.py +0 -0
  70. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_llm.py +0 -0
  71. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_llm_api.py +0 -0
  72. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_mic_gain.py +0 -0
  73. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_modifier_guard.py +0 -0
  74. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_numbers.py +0 -0
  75. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_paste_last.py +0 -0
  76. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_pipeline.py +0 -0
  77. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_platform.py +0 -0
  78. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_postcorrect.py +0 -0
  79. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_postprocess.py +0 -0
  80. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_prebuffer.py +0 -0
  81. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_presence.py +0 -0
  82. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_prompt.py +0 -0
  83. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_quiet_audio.py +0 -0
  84. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_recorder_integration.py +0 -0
  85. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_retention.py +0 -0
  86. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_robustness.py +0 -0
  87. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_security_hardening.py +0 -0
  88. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_server.py +0 -0
  89. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_service.py +0 -0
  90. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_setup.py +0 -0
  91. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_sherpa.py +0 -0
  92. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_spool.py +0 -0
  93. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_streaming.py +0 -0
  94. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_suggest.py +0 -0
  95. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_tokens.py +0 -0
  96. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_transcriber.py +0 -0
  97. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_tray.py +0 -0
  98. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_tts.py +0 -0
  99. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_typer_manager.py +0 -0
  100. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_vad.py +0 -0
  101. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_vocabulary.py +0 -0
  102. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_wordfreq.py +0 -0
  103. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/tests/test_worker_decode.py +0 -0
  104. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/__main__.py +0 -0
  105. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/announce.py +0 -0
  106. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/app.py +0 -0
  107. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/audio_source.py +0 -0
  108. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/backends.py +0 -0
  109. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/configcmd.py +0 -0
  110. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/corrections.py +0 -0
  111. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/history.py +0 -0
  112. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/learn.py +0 -0
  113. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/models.py +0 -0
  114. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/servicecmd.py +0 -0
  115. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/uninstall.py +0 -0
  116. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/cli/vocab.py +0 -0
  117. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/clipboard_read.py +0 -0
  118. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/commands.py +0 -0
  119. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/config.py +0 -0
  120. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/consent.py +0 -0
  121. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/context_terms.py +0 -0
  122. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/__init__.py +0 -0
  123. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/bias.py +0 -0
  124. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/__init__.py +0 -0
  125. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/base.py +0 -0
  126. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/catalog.py +0 -0
  127. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/faster_whisper/__init__.py +0 -0
  128. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/faster_whisper/worker.py +0 -0
  129. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/fetch.py +0 -0
  130. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/lanes.py +0 -0
  131. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/sherpa.py +0 -0
  132. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/decoders/whispercpp.py +0 -0
  133. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/engine.py +0 -0
  134. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/core/pipeline.py +0 -0
  135. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/corrections.py +0 -0
  136. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/data/60-voiceio-uaccess.rules +0 -0
  137. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/data/__init__.py +0 -0
  138. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/demo.py +0 -0
  139. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/display.py +0 -0
  140. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/errorlog.py +0 -0
  141. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/feedback.py +0 -0
  142. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/focus.py +0 -0
  143. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/health.py +0 -0
  144. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hints.py +0 -0
  145. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/history.py +0 -0
  146. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hotkeys/__init__.py +0 -0
  147. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hotkeys/base.py +0 -0
  148. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hotkeys/chain.py +0 -0
  149. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hotkeys/evdev.py +0 -0
  150. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hotkeys/pynput_backend.py +0 -0
  151. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/hotkeys/socket_backend.py +0 -0
  152. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ibus/__init__.py +0 -0
  153. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ibus/engine.py +0 -0
  154. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ibus/install.py +0 -0
  155. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ibus/pending.py +0 -0
  156. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ibus/session.py +0 -0
  157. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ibus/textlimit.py +0 -0
  158. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/idle_audio.py +0 -0
  159. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/install_env.py +0 -0
  160. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/__init__.py +0 -0
  161. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/augment.py +0 -0
  162. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/clean.py +0 -0
  163. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/evaluate.py +0 -0
  164. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/importer.py +0 -0
  165. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/metrics.py +0 -0
  166. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/quiet.py +0 -0
  167. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/review.py +0 -0
  168. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/store.py +0 -0
  169. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/teacher.py +0 -0
  170. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/learn/train.py +0 -0
  171. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/llm.py +0 -0
  172. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/llm_api.py +0 -0
  173. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/mic_gain.py +0 -0
  174. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/models/__init__.py +0 -0
  175. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/models/silero_vad.onnx +0 -0
  176. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/numbers.py +0 -0
  177. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/pidlock.py +0 -0
  178. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/platform.py +0 -0
  179. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/postcorrect.py +0 -0
  180. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/postprocess.py +0 -0
  181. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/power.py +0 -0
  182. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/presence.py +0 -0
  183. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/privacy.py +0 -0
  184. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/prompt.py +0 -0
  185. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/quiet_audio.py +0 -0
  186. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/recorder.py +0 -0
  187. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/retention.py +0 -0
  188. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/server/__init__.py +0 -0
  189. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/server/__main__.py +0 -0
  190. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/server/app.py +0 -0
  191. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/server/config.py +0 -0
  192. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/server/runtime.py +0 -0
  193. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/service.py +0 -0
  194. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/__init__.py +0 -0
  195. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/configfile.py +0 -0
  196. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/extras.py +0 -0
  197. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/hotkey.py +0 -0
  198. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/noninteractive.py +0 -0
  199. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/speech.py +0 -0
  200. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/steps.py +0 -0
  201. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/system.py +0 -0
  202. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/setup/ui.py +0 -0
  203. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/sounds/__init__.py +0 -0
  204. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/sounds/alert.wav +0 -0
  205. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/sounds/commit.wav +0 -0
  206. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/sounds/start.wav +0 -0
  207. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/sounds/stop.wav +0 -0
  208. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/spool.py +0 -0
  209. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/streaming.py +0 -0
  210. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/suggest.py +0 -0
  211. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tokens.py +0 -0
  212. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tray/__init__.py +0 -0
  213. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tray/_icons.py +0 -0
  214. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tray/_indicator.py +0 -0
  215. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tray/_pystray.py +0 -0
  216. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/__init__.py +0 -0
  217. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/base.py +0 -0
  218. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/chain.py +0 -0
  219. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/edge_engine.py +0 -0
  220. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/espeak.py +0 -0
  221. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/piper_engine.py +0 -0
  222. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/player.py +0 -0
  223. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/tts/supertonic_engine.py +0 -0
  224. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/__init__.py +0 -0
  225. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/base.py +0 -0
  226. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/chain.py +0 -0
  227. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/clipboard.py +0 -0
  228. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/collecting.py +0 -0
  229. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/fcitx_bridge.py +0 -0
  230. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/ibus.py +0 -0
  231. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/manager.py +0 -0
  232. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/modifier_guard.py +0 -0
  233. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/paste.py +0 -0
  234. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/pynput_type.py +0 -0
  235. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/wtype.py +0 -0
  236. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/xdotool.py +0 -0
  237. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/typers/ydotool.py +0 -0
  238. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/ui.py +0 -0
  239. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/vad.py +0 -0
  240. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/vocab_stats.py +0 -0
  241. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/vocabulary.py +0 -0
  242. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/watchdog.py +0 -0
  243. {python_voiceio-1.18.5 → python_voiceio-1.18.6}/voiceio/wordfreq.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-voiceio
3
- Version: 1.18.5
3
+ Version: 1.18.6
4
4
  Summary: Voice dictation for Linux. Speak → text, locally, instantly.
5
5
  Author: Hugo Montenegro
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-voiceio"
7
- version = "1.18.5"
7
+ version = "1.18.6"
8
8
  description = "Voice dictation for Linux. Speak → text, locally, instantly."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-voiceio
3
- Version: 1.18.5
3
+ Version: 1.18.6
4
4
  Summary: Voice dictation for Linux. Speak → text, locally, instantly.
5
5
  Author: Hugo Montenegro
6
6
  License-Expression: MIT
@@ -71,6 +71,7 @@ tests/test_presence.py
71
71
  tests/test_prompt.py
72
72
  tests/test_quiet_audio.py
73
73
  tests/test_recorder_integration.py
74
+ tests/test_replies.py
74
75
  tests/test_report.py
75
76
  tests/test_retention.py
76
77
  tests/test_robustness.py
@@ -127,6 +128,7 @@ voiceio/privacy.py
127
128
  voiceio/prompt.py
128
129
  voiceio/quiet_audio.py
129
130
  voiceio/recorder.py
131
+ voiceio/replies.py
130
132
  voiceio/report.py
131
133
  voiceio/retention.py
132
134
  voiceio/service.py
@@ -147,6 +149,7 @@ voiceio/cli/doctor.py
147
149
  voiceio/cli/history.py
148
150
  voiceio/cli/learn.py
149
151
  voiceio/cli/models.py
152
+ voiceio/cli/replies.py
150
153
  voiceio/cli/servicecmd.py
151
154
  voiceio/cli/uninstall.py
152
155
  voiceio/cli/vocab.py
@@ -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 and report.BOARD_URL 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 report.BOARD_URL in out
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):
@@ -0,0 +1 @@
1
+ __version__ = "1.18.6"
@@ -14,7 +14,8 @@ def main() -> None:
14
14
  """voiceio COMMAND [options] — see `voiceio --help`."""
15
15
  from voiceio import __version__
16
16
  from voiceio.cli import (
17
- configcmd, corrections, doctor, history, learn, models, servicecmd, uninstall, vocab,
17
+ configcmd, corrections, doctor, history, learn, models, replies, servicecmd, uninstall,
18
+ vocab,
18
19
  )
19
20
 
20
21
  parser = argparse.ArgumentParser(
@@ -66,6 +67,7 @@ def main() -> None:
66
67
  p_setup.set_defaults(func=_cmd_setup)
67
68
 
68
69
  doctor.register(sub)
70
+ replies.register(sub)
69
71
  servicecmd.register(sub)
70
72
  models.register(sub)
71
73
  vocab.register(sub)
@@ -80,6 +80,9 @@ def _cmd_doctor(args: argparse.Namespace) -> None:
80
80
  report = check_health()
81
81
  print(format_report(report))
82
82
  print(format_usage(usage_findings()))
83
+ from voiceio.replies import nudge
84
+ if line := nudge():
85
+ print(f"\n{line}")
83
86
  if args.live:
84
87
  from voiceio.setup import run_test
85
88
  run_test()
@@ -0,0 +1,18 @@
1
+ """`voiceio replies` — answers to the reports you posted."""
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import sys
6
+
7
+
8
+ def register(sub: argparse._SubParsersAction) -> None:
9
+ sub.add_parser(
10
+ "replies", help="Read the answers to reports you posted with doctor --report",
11
+ description="Shows the replies to each report this computer posted in the last "
12
+ "60 days. It fetches only those threads from swarmmemo.com.",
13
+ ).set_defaults(func=cmd_replies)
14
+
15
+
16
+ def cmd_replies(args: argparse.Namespace) -> None:
17
+ from voiceio.replies import show
18
+ sys.exit(show())
@@ -0,0 +1,231 @@
1
+ """Answers to the reports you posted with `voiceio doctor --report`.
2
+
3
+ The maintainer answers each report as a reply on the public board. voiceio
4
+ remembers the receipt id of each report it posted (nothing else), so
5
+ `voiceio replies` can read those threads and `voiceio doctor` can say when an
6
+ answer arrived. The only requests are GETs for those ids; nothing about the
7
+ user is sent. Board text is written by anyone, so it is cleaned of terminal
8
+ escapes and control characters before it is printed.
9
+ """
10
+ from __future__ import annotations
11
+
12
+ import datetime as dt
13
+ import json
14
+ import re
15
+ import time
16
+ import urllib.parse
17
+ from dataclasses import dataclass
18
+ from pathlib import Path
19
+
20
+ THREAD_API = "https://swarmmemo.com/api/thread/"
21
+ # swarmmemo.com serves one post and its replies as a page to browsers (plain
22
+ # text to curl). The board on voiceio.dev only loads its comments when you
23
+ # scroll to them, so it cannot open at one report.
24
+ POST_PAGE = "https://swarmmemo.com/e/"
25
+ MAINTAINER_KEY = "3965ebe50d0e7427bea1441b7f997581299eaeadde993b3a1e90466411a64769"
26
+ MAX_SAVED = 20
27
+ KEEP_DAYS = 60
28
+ NUDGE_DAYS = 30
29
+ TIMEOUT_SECS = 5.0
30
+ NUDGE_TIMEOUT_SECS = 2.0
31
+
32
+ _ID = re.compile(r"^[A-Za-z0-9_-]{1,128}$")
33
+ # C0/C1 controls and DEL, except newline and tab.
34
+ _CONTROL = re.compile(r"[\x00-\x08\x0b-\x1f\x7f-\x9f]")
35
+
36
+
37
+ def _path() -> Path:
38
+ from voiceio.config import LOG_DIR
39
+ return LOG_DIR / "reports.json"
40
+
41
+
42
+ def post_url(report_id: str) -> str:
43
+ return POST_PAGE + urllib.parse.quote(report_id, safe="")
44
+
45
+
46
+ # ── saved reports ──
47
+
48
+ def _load() -> list[dict]:
49
+ try:
50
+ raw = json.loads(_path().read_text())
51
+ except (OSError, ValueError):
52
+ return []
53
+ reports = raw.get("reports") if isinstance(raw, dict) else None
54
+ out = []
55
+ for r in reports if isinstance(reports, list) else ():
56
+ if (isinstance(r, dict) and isinstance(r.get("id"), str) and _ID.match(r["id"])
57
+ and isinstance(r.get("posted_at"), (int, float))):
58
+ out.append({"id": r["id"], "posted_at": float(r["posted_at"]),
59
+ "read_until": float(r.get("read_until") or 0)})
60
+ return out
61
+
62
+
63
+ def _prune(reports: list[dict], now: float) -> list[dict]:
64
+ fresh = [r for r in reports if now - r["posted_at"] < KEEP_DAYS * 86400]
65
+ fresh.sort(key=lambda r: r["posted_at"], reverse=True)
66
+ return fresh[:MAX_SAVED]
67
+
68
+
69
+ def _save(reports: list[dict]) -> None:
70
+ from voiceio.config import _SECURE_FILE, _chmod, private_dir
71
+ path = _path()
72
+ private_dir(path.parent)
73
+ path.write_text(json.dumps({"reports": reports}, indent=1))
74
+ _chmod(path, _SECURE_FILE)
75
+
76
+
77
+ def saved(now: float | None = None) -> list[dict]:
78
+ """Saved reports, newest first, without the expired ones."""
79
+ return _prune(_load(), time.time() if now is None else now)
80
+
81
+
82
+ def remember(report_id: str, now: float | None = None) -> None:
83
+ """Keep the receipt id of a report just posted. Never raises."""
84
+ now = time.time() if now is None else now
85
+ try:
86
+ if not _ID.match(report_id):
87
+ return
88
+ reports = [r for r in _load() if r["id"] != report_id]
89
+ reports.append({"id": report_id, "posted_at": now, "read_until": 0.0})
90
+ _save(_prune(reports, now))
91
+ except Exception: # noqa: BLE001 — remembering must never fail a post
92
+ pass
93
+
94
+
95
+ def _mark_read(read: dict[str, float]) -> None:
96
+ """Record, per report, the board time of the newest reply shown."""
97
+ if not read:
98
+ return
99
+ try:
100
+ reports = _load()
101
+ for r in reports:
102
+ if r["id"] in read:
103
+ r["read_until"] = max(r["read_until"], read[r["id"]])
104
+ _save(_prune(reports, time.time()))
105
+ except Exception: # noqa: BLE001
106
+ pass
107
+
108
+
109
+ # ── the board ──
110
+
111
+ @dataclass
112
+ class Reply:
113
+ id: str
114
+ maintainer: bool
115
+ created_at: float
116
+ text: str
117
+ new: bool = False
118
+
119
+ @property
120
+ def label(self) -> str:
121
+ return "voiceio maintainer" if self.maintainer else "reply"
122
+
123
+
124
+ def clean(text: str) -> str:
125
+ """Board text made safe for a terminal: no escapes, no control chars."""
126
+ from voiceio.report import _ESCAPE
127
+ text = _ESCAPE.sub("", str(text)).replace("\r\n", "\n").replace("\r", "\n")
128
+ return _CONTROL.sub("", text).strip()
129
+
130
+
131
+ def parse_thread(body: object, report_id: str, read_until: float = 0.0) -> list[Reply]:
132
+ """The visible replies in a thread, oldest first. Raises ValueError on a
133
+ response that is not a thread."""
134
+ if not isinstance(body, dict) or body.get("ok") is not True \
135
+ or not isinstance(body.get("messages"), list):
136
+ raise ValueError("unexpected response")
137
+ messages = [m for m in body["messages"] if isinstance(m, dict)]
138
+ # A thread is the whole conversation from its first post: keep only what
139
+ # answers this report, directly or down a chain of replies.
140
+ under = {report_id}
141
+ grew = True
142
+ while grew:
143
+ grew = False
144
+ for m in messages:
145
+ if m.get("reply_to") in under and m.get("id") not in under:
146
+ under.add(m.get("id"))
147
+ grew = True
148
+ out = []
149
+ for m in messages:
150
+ if m.get("id") == report_id or m.get("id") not in under or m.get("hidden"):
151
+ continue
152
+ try:
153
+ created = float(m.get("created_at") or 0)
154
+ except (TypeError, ValueError):
155
+ created = 0.0
156
+ # The key, not the handle: only the key proves who wrote it.
157
+ maintainer = m.get("author") == MAINTAINER_KEY
158
+ out.append(Reply(id=str(m.get("id", "")), maintainer=maintainer, created_at=created,
159
+ text=clean(m.get("text", "")), new=created > read_until))
160
+ out.sort(key=lambda r: r.created_at)
161
+ return out
162
+
163
+
164
+ def fetch(report_id: str, *, timeout: float = TIMEOUT_SECS) -> dict:
165
+ """GET one thread as JSON. Raises on any failure; callers catch."""
166
+ from voiceio import report
167
+ url = THREAD_API + urllib.parse.quote(report_id, safe="") + "?limit=100"
168
+ with report._urlopen(url, timeout=timeout) as resp:
169
+ return json.loads(resp.read().decode("utf-8", errors="replace"))
170
+
171
+
172
+ # ── front ends ──
173
+
174
+ def _when(ts: float) -> str:
175
+ return dt.datetime.fromtimestamp(ts).strftime("%Y-%m-%d %H:%M") if ts else "?"
176
+
177
+
178
+ def show() -> int:
179
+ """`voiceio replies`: print each saved report's replies. Exit code."""
180
+ reports = saved()
181
+ if not reports:
182
+ print("You have no reports from this computer in the last "
183
+ f"{KEEP_DAYS} days.\nFile one with: voiceio doctor --report")
184
+ return 0
185
+ failed = 0
186
+ read: dict[str, float] = {}
187
+ for r in reports:
188
+ print(f"Report from {_when(r['posted_at'])}: {post_url(r['id'])}")
189
+ try:
190
+ replies = parse_thread(fetch(r["id"]), r["id"], r["read_until"])
191
+ except Exception as e: # noqa: BLE001 — offline, a bad answer: say so, go on
192
+ failed += 1
193
+ print(f" Could not load the replies ({type(e).__name__}).\n")
194
+ continue
195
+ if not replies:
196
+ print(" No replies yet. The maintainer usually answers within a day.\n")
197
+ continue
198
+ for rep in replies:
199
+ mark = " [new]" if rep.new else ""
200
+ print(f" {rep.label} · {_when(rep.created_at)}{mark}")
201
+ for line in rep.text.splitlines() or [""]:
202
+ print(f" {line}".rstrip())
203
+ print()
204
+ read[r["id"]] = max(rep.created_at for rep in replies)
205
+ _mark_read(read)
206
+ if failed == len(reports):
207
+ print("Could not reach swarmmemo.com. Are you offline? The links above open "
208
+ "the reports in a browser.")
209
+ return 1
210
+ if read:
211
+ print("To answer, open the report's link and reply there.")
212
+ return 0
213
+
214
+
215
+ def nudge() -> str:
216
+ """One line for `voiceio doctor` when the maintainer answered a recent
217
+ report since you last ran `voiceio replies`, else "". One request to the
218
+ newest recent report, short timeout, never raises."""
219
+ try:
220
+ now = time.time()
221
+ recent = [r for r in saved(now) if now - r["posted_at"] < NUDGE_DAYS * 86400]
222
+ if not recent:
223
+ return ""
224
+ r = recent[0]
225
+ replies = parse_thread(fetch(r["id"], timeout=NUDGE_TIMEOUT_SECS),
226
+ r["id"], r["read_until"])
227
+ if any(rep.maintainer and rep.new for rep in replies):
228
+ return "The maintainer answered your report. Read it with: voiceio replies"
229
+ except Exception: # noqa: BLE001 — offline or anything else: say nothing
230
+ pass
231
+ return ""
@@ -299,7 +299,11 @@ def share(text: str, *, yes: bool = False) -> bool:
299
299
  return False
300
300
  ok, detail = post(text)
301
301
  if ok:
302
- print(f"Posted, thanks. See it at {BOARD_URL}")
302
+ from voiceio import replies
303
+ replies.remember(detail)
304
+ print(f"Posted, thanks. Your report: {replies.post_url(detail)}\n"
305
+ "The maintainer usually answers there within a day. Run 'voiceio replies' "
306
+ "to read answers here;\n'voiceio doctor' tells you when one arrives.")
303
307
  return True
304
308
  print(f"Could not confirm the post ({scrub(detail)}). Check {BOARD_URL} "
305
309
  f"and paste it there if it's missing.")
@@ -1 +0,0 @@
1
- __version__ = "1.18.5"
File without changes