()
| 144 | |
| 145 | |
| 146 | def typed_loop(): |
| 147 | say("Type mode is active. Type /voice to return to listening.") |
| 148 | while True: |
| 149 | try: |
| 150 | user_input = input("You: ").strip() |
| 151 | except (EOFError, KeyboardInterrupt): |
| 152 | print() |
| 153 | say("Goodbye.") |
| 154 | break |
| 155 | if not user_input: |
| 156 | continue |
| 157 | if should_exit(user_input): |
| 158 | say("Goodbye.") |
| 159 | break |
| 160 | if normalize_text(user_input) in {"/voice", "voice", "listen", "listening"}: |
| 161 | voice_loop() |
| 162 | break |
| 163 | if normalize_text(user_input) in {"/refresh", "refresh apps"}: |
| 164 | apps = build_application_index() |
| 165 | say(f"Safe app index refreshed: {len(apps)} apps found.") |
| 166 | continue |
| 167 | handle_and_say(user_input) |
| 168 | |
| 169 | |
| 170 | def main(argv=None): |
no test coverage detected