iobroker.assistant 1.8.0 → 1.9.1

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 (45) hide show
  1. package/README.md +6 -0
  2. package/admin/custom/.vite/manifest.json +1 -1
  3. package/admin/custom/assets/Components-BZeMTVhf.js +2 -0
  4. package/admin/custom/customComponents.js +1 -1
  5. package/admin/custom/i18n/de.json +4 -1
  6. package/admin/custom/i18n/en.json +4 -1
  7. package/admin/custom/i18n/es.json +4 -1
  8. package/admin/custom/i18n/fr.json +4 -1
  9. package/admin/custom/i18n/it.json +4 -1
  10. package/admin/custom/i18n/nl.json +4 -1
  11. package/admin/custom/i18n/pl.json +4 -1
  12. package/admin/custom/i18n/pt.json +4 -1
  13. package/admin/custom/i18n/ru.json +4 -1
  14. package/admin/custom/i18n/uk.json +4 -1
  15. package/admin/custom/i18n/zh-cn.json +4 -1
  16. package/admin/custom/index.html +1 -1
  17. package/admin/custom/mf-manifest.json +1 -1
  18. package/admin/custom/mf-stats.json +1 -1
  19. package/admin/i18n/de.json +10 -7
  20. package/admin/i18n/en.json +10 -7
  21. package/admin/i18n/es.json +10 -7
  22. package/admin/i18n/fr.json +10 -7
  23. package/admin/i18n/it.json +10 -7
  24. package/admin/i18n/nl.json +10 -7
  25. package/admin/i18n/pl.json +10 -7
  26. package/admin/i18n/pt.json +10 -7
  27. package/admin/i18n/ru.json +10 -7
  28. package/admin/i18n/uk.json +10 -7
  29. package/admin/i18n/zh-cn.json +10 -7
  30. package/admin/jsonConfig.json +69 -13
  31. package/build/lib/installer.js +1 -1
  32. package/build/lib/installer.js.map +1 -1
  33. package/build/lib/messages.js +17 -0
  34. package/build/lib/messages.js.map +1 -0
  35. package/build/lib/voice/engines.js +42 -9
  36. package/build/lib/voice/engines.js.map +1 -1
  37. package/build/lib/voice/parakeet.js +12 -3
  38. package/build/lib/voice/parakeet.js.map +1 -1
  39. package/build/lib/voice/speechLanguage.js +4 -3
  40. package/build/lib/voice/speechLanguage.js.map +1 -1
  41. package/build/main.js +52 -10
  42. package/build/main.js.map +1 -1
  43. package/io-package.json +27 -27
  44. package/package.json +1 -1
  45. package/admin/custom/assets/Components-DGifJGYx.js +0 -2
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Verifica ffmpeg",
231
231
  "Download ffmpeg": "Scarica ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Scarica un ffmpeg statico (ffmpeg-static, 20-30 MB) nella directory dei dati dell'istanza. Viene usato quando non è indicato alcun percorso.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (adattatore locale)",
234
- "ai-parakeet instance": "Istanza di ai-parakeet",
235
- "Install ai-parakeet": "Installa ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (adattatore locale)",
234
+ "ioBroker.voice instance": "Istanza di ioBroker.voice",
235
+ "Install ioBroker.voice": "Installa ioBroker.voice",
236
236
  "Install pi-agent": "Installa pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Installa l'adattatore pi-agent sull'host di questa istanza e ne crea un'istanza. Richiede alcuni minuti. Poi scegli il suo modello nelle sue impostazioni oppure usa le impostazioni IA di sistema di admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Installa l'adattatore ai-parakeet sull'host di questa istanza e ne crea un'istanza. Richiede alcuni minuti. Al primo avvio scarica il modello vocale (circa 670 MB); poi gli servono circa 1,1 GB di memoria.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Installa l'adattatore ioBroker.voice sull'host di questa istanza e ne crea un'istanza. Richiede alcuni minuti. Al primo avvio scarica il modello vocale (circa 670 MB); poi gli servono circa 1,1 GB di memoria.",
239
239
  "Install": "Installa",
240
240
  "Cancel": "Annulla",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s è stato installato e selezionato. Salva le impostazioni per usarlo.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s è già installato e ora è selezionato. Salva le impostazioni per usarlo.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "L'adattatore ai-parakeet riconosce la voce offline sulla CPU del suo host, in 25 lingue europee che il modello rileva da solo. L'audio gli arriva tramite il bus dei messaggi di ioBroker, quindi l'istanza può anche girare su un altro host.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "L'adattatore ioBroker.voice riconosce la voce offline sulla CPU del suo host, in 25 lingue europee che il modello rileva da solo. L'audio gli arriva tramite il bus dei messaggi di ioBroker, quindi l'istanza può anche girare su un altro host.",
244
244
  "Local model URL (GGUF, old setting)": "URL del modello locale (GGUF, vecchia impostazione)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Usato solo finché nella scheda \"Modelli locali\" non è scelto un modello. Scegli il modello lì.",
246
246
  "Local models": "Modelli locali",
@@ -261,6 +261,9 @@
261
261
  "Status": "Stato",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Voice per answer language",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Language (e.g. ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). Il modello (solo OpenAI e OpenRouter) sostituisce per questa lingua il modello TTS sopra, ad es. ru → elevenlabs/eleven-multilingual-v2; senza voce un altro modello OpenRouter usa la sua prima voce per la lingua.",
265
+ "Language (e.g. ru)": "Language (e.g. ru)",
266
+ "TTS model (optional)": "Modello TTS (facoltativo)",
267
+ "Voice (optional)": "Voce (facoltativo)",
268
+ "Test": "Test"
266
269
  }
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "ffmpeg controleren",
231
231
  "Download ffmpeg": "ffmpeg downloaden",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Downloadt een statische ffmpeg (ffmpeg-static, 20-30 MB) naar de gegevensmap van de instantie. Die wordt gebruikt als er geen pad is ingevuld.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (lokale adapter)",
234
- "ai-parakeet instance": "ai-parakeet-instantie",
235
- "Install ai-parakeet": "ai-parakeet installeren",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (lokale adapter)",
234
+ "ioBroker.voice instance": "ioBroker.voice-instantie",
235
+ "Install ioBroker.voice": "ioBroker.voice installeren",
236
236
  "Install pi-agent": "pi-agent installeren",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Dit installeert de adapter pi-agent op de host van deze instantie en maakt er een instantie van aan. Dat duurt een paar minuten. Kies daarna het model in de instellingen ervan, of gebruik de systeembrede AI-instellingen van admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Dit installeert de adapter ai-parakeet op de host van deze instantie en maakt er een instantie van aan. Dat duurt een paar minuten. Bij de eerste start downloadt hij het spraakmodel (ongeveer 670 MB); daarna heeft hij ongeveer 1,1 GB geheugen nodig.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Dit installeert de adapter ioBroker.voice op de host van deze instantie en maakt er een instantie van aan. Dat duurt een paar minuten. Bij de eerste start downloadt hij het spraakmodel (ongeveer 670 MB); daarna heeft hij ongeveer 1,1 GB geheugen nodig.",
239
239
  "Install": "Installeren",
240
240
  "Cancel": "Annuleren",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s is geïnstalleerd en geselecteerd. Sla de instellingen op om hem te gebruiken.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s is al geïnstalleerd en nu geselecteerd. Sla de instellingen op om hem te gebruiken.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "De adapter ai-parakeet herkent spraak offline op de CPU van zijn host, in 25 Europese talen die het model zelf herkent. Het geluid gaat via de berichtenbus van ioBroker naar hem toe, dus de instantie kan ook op een andere host draaien.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "De adapter ioBroker.voice herkent spraak offline op de CPU van zijn host, in 25 Europese talen die het model zelf herkent. Het geluid gaat via de berichtenbus van ioBroker naar hem toe, dus de instantie kan ook op een andere host draaien.",
244
244
  "Local model URL (GGUF, old setting)": "URL van het lokale model (GGUF, oude instelling)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Alleen gebruikt zolang er op het tabblad \"Lokale modellen\" geen model is gekozen. Kies het model daar.",
246
246
  "Local models": "Lokale modellen",
@@ -261,6 +261,9 @@
261
261
  "Status": "Status",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Voice per answer language",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Language (e.g. ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). Het model (alleen OpenAI en OpenRouter) vervangt voor deze taal het TTS-model hierboven, bijv. ru → elevenlabs/eleven-multilingual-v2; zonder stem neemt een ander OpenRouter-model zijn eerste stem voor de taal.",
265
+ "Language (e.g. ru)": "Language (e.g. ru)",
266
+ "TTS model (optional)": "TTS-model (optioneel)",
267
+ "Voice (optional)": "Stem (optioneel)",
268
+ "Test": "Test"
266
269
  }
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Sprawdź ffmpeg",
231
231
  "Download ffmpeg": "Pobierz ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Pobiera statyczny ffmpeg (ffmpeg-static, 20–30 MB) do katalogu danych instancji. Jest używany, gdy nie podano ścieżki.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (lokalny adapter)",
234
- "ai-parakeet instance": "Instancja ai-parakeet",
235
- "Install ai-parakeet": "Zainstaluj ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (lokalny adapter)",
234
+ "ioBroker.voice instance": "Instancja ioBroker.voice",
235
+ "Install ioBroker.voice": "Zainstaluj ioBroker.voice",
236
236
  "Install pi-agent": "Zainstaluj pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Instaluje adapter pi-agent na hoście tej instancji i tworzy jego instancję. Trwa to kilka minut. Następnie wybierz model w jego ustawieniach albo użyj ogólnosystemowych ustawień AI w admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Instaluje adapter ai-parakeet na hoście tej instancji i tworzy jego instancję. Trwa to kilka minut. Przy pierwszym uruchomieniu pobiera model mowy (około 670 MB); potem potrzebuje około 1,1 GB pamięci.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Instaluje adapter ioBroker.voice na hoście tej instancji i tworzy jego instancję. Trwa to kilka minut. Przy pierwszym uruchomieniu pobiera model mowy (około 670 MB); potem potrzebuje około 1,1 GB pamięci.",
239
239
  "Install": "Zainstaluj",
240
240
  "Cancel": "Anuluj",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s został zainstalowany i wybrany. Zapisz ustawienia, aby go używać.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s jest już zainstalowany i teraz wybrany. Zapisz ustawienia, aby go używać.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Adapter ai-parakeet rozpoznaje mowę offline na procesorze swojego hosta, w 25 językach europejskich, które model rozpoznaje sam. Dźwięk trafia do niego przez magistralę wiadomości ioBroker, więc instancja może też działać na innym hoście.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Adapter ioBroker.voice rozpoznaje mowę offline na procesorze swojego hosta, w 25 językach europejskich, które model rozpoznaje sam. Dźwięk trafia do niego przez magistralę wiadomości ioBroker, więc instancja może też działać na innym hoście.",
244
244
  "Local model URL (GGUF, old setting)": "URL modelu lokalnego (GGUF, stare ustawienie)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Używane tylko, dopóki na karcie „Modele lokalne” nie wybrano modelu. Wybierz model tam.",
246
246
  "Local models": "Modele lokalne",
@@ -261,6 +261,9 @@
261
261
  "Status": "Stan",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Voice per answer language",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Language (e.g. ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). Model (tylko OpenAI i OpenRouter) zastępuje dla tego języka model TTS powyżej, np. ru → elevenlabs/eleven-multilingual-v2; bez głosu inny model OpenRouter bierze swój pierwszy głos dla tego języka.",
265
+ "Language (e.g. ru)": "Language (e.g. ru)",
266
+ "TTS model (optional)": "Model TTS (opcjonalnie)",
267
+ "Voice (optional)": "Głos (opcjonalnie)",
268
+ "Test": "Test"
266
269
  }
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Verificar ffmpeg",
231
231
  "Download ffmpeg": "Transferir ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Transfere um ffmpeg estático (ffmpeg-static, 20-30 MB) para o diretório de dados da instância. É usado quando nenhum caminho é indicado.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (adaptador local)",
234
- "ai-parakeet instance": "Instância do ai-parakeet",
235
- "Install ai-parakeet": "Instalar ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (adaptador local)",
234
+ "ioBroker.voice instance": "Instância do ioBroker.voice",
235
+ "Install ioBroker.voice": "Instalar ioBroker.voice",
236
236
  "Install pi-agent": "Instalar pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Isto instala o adaptador pi-agent no host desta instância e cria uma instância dele. Demora alguns minutos. Depois escolha o modelo nas configurações dele ou use as configurações de IA de todo o sistema do admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Isto instala o adaptador ai-parakeet no host desta instância e cria uma instância dele. Demora alguns minutos. No primeiro arranque transfere o modelo de voz (cerca de 670 MB); depois precisa de cerca de 1,1 GB de memória.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Isto instala o adaptador ioBroker.voice no host desta instância e cria uma instância dele. Demora alguns minutos. No primeiro arranque transfere o modelo de voz (cerca de 670 MB); depois precisa de cerca de 1,1 GB de memória.",
239
239
  "Install": "Instalar",
240
240
  "Cancel": "Cancelar",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s foi instalado e selecionado. Guarde as configurações para o usar.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s já está instalado e agora está selecionado. Guarde as configurações para o usar.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "O adaptador ai-parakeet reconhece a fala offline no CPU do seu host, em 25 línguas europeias que o modelo deteta sozinho. O áudio chega-lhe pelo barramento de mensagens do ioBroker, por isso a instância também pode correr noutro host.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "O adaptador ioBroker.voice reconhece a fala offline no CPU do seu host, em 25 línguas europeias que o modelo deteta sozinho. O áudio chega-lhe pelo barramento de mensagens do ioBroker, por isso a instância também pode correr noutro host.",
244
244
  "Local model URL (GGUF, old setting)": "URL do modelo local (GGUF, configuração antiga)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Usado apenas enquanto nenhum modelo estiver escolhido na aba \"Modelos locais\". Escolha o modelo lá.",
246
246
  "Local models": "Modelos locais",
@@ -261,6 +261,9 @@
261
261
  "Status": "Estado",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Voice per answer language",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Language (e.g. ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). O modelo (apenas OpenAI e OpenRouter) substitui para este idioma o modelo TTS acima, p. ex. ru → elevenlabs/eleven-multilingual-v2; sem voz, outro modelo OpenRouter usa a sua primeira voz para o idioma.",
265
+ "Language (e.g. ru)": "Language (e.g. ru)",
266
+ "TTS model (optional)": "Modelo TTS (opcional)",
267
+ "Voice (optional)": "Voz (opcional)",
268
+ "Test": "Teste"
266
269
  }
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Проверить ffmpeg",
231
231
  "Download ffmpeg": "Загрузить ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Загружает статический ffmpeg (ffmpeg-static, 20–30 МБ) в каталог данных экземпляра. Используется, если путь не указан.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (локальный адаптер)",
234
- "ai-parakeet instance": "Экземпляр ai-parakeet",
235
- "Install ai-parakeet": "Установить ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (локальный адаптер)",
234
+ "ioBroker.voice instance": "Экземпляр ioBroker.voice",
235
+ "Install ioBroker.voice": "Установить ioBroker.voice",
236
236
  "Install pi-agent": "Установить pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Адаптер pi-agent будет установлен на хост этого экземпляра, и будет создан его экземпляр. Это займёт несколько минут. Затем выберите модель в его настройках или используйте общесистемные настройки ИИ в admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ai-parakeet будет установлен на хост этого экземпляра, и будет создан его экземпляр. Это займёт несколько минут. При первом запуске он скачает речевую модель (около 670 МБ); затем ему нужно около 1,1 ГБ памяти.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ioBroker.voice будет установлен на хост этого экземпляра, и будет создан его экземпляр. Это займёт несколько минут. При первом запуске он скачает речевую модель (около 670 МБ); затем ему нужно около 1,1 ГБ памяти.",
239
239
  "Install": "Установить",
240
240
  "Cancel": "Отмена",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s установлен и выбран. Сохраните настройки, чтобы им пользоваться.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s уже установлен и теперь выбран. Сохраните настройки, чтобы им пользоваться.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ai-parakeet распознаёт речь офлайн на процессоре своего хоста, на 25 европейских языках, которые модель определяет сама. Аудио идёт к нему через шину сообщений ioBroker, поэтому экземпляр может работать и на другом хосте.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ioBroker.voice распознаёт речь офлайн на процессоре своего хоста, на 25 европейских языках, которые модель определяет сама. Аудио идёт к нему через шину сообщений ioBroker, поэтому экземпляр может работать и на другом хосте.",
244
244
  "Local model URL (GGUF, old setting)": "URL локальной модели (GGUF, старая настройка)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Используется, только пока на вкладке «Локальные модели» не выбрана модель. Лучше выберите модель там.",
246
246
  "Local models": "Локальные модели",
@@ -261,6 +261,9 @@
261
261
  "Status": "Статус",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Голос для языка ответа",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "Ответ на другом языке, чем язык сателлитов (например, pi-agent отвечает на русский вопрос по-русски), озвучивается голосом этого языка, а не читается по буквам голосом, выбранным выше. Без строки берётся стандартный голос провайдера для этого языка. Имена голосов провайдера синтеза речи, например ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Язык (например, ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "Ответ на другом языке, чем язык сателлитов (например, pi-agent отвечает на русский вопрос по-русски), озвучивается голосом этого языка, а не читается по буквам голосом, выбранным выше. Без строки берётся стандартный голос провайдера для этого языка. Имена голосов провайдера синтеза речи, например ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). Модель (только OpenAI и OpenRouter) заменяет для этого языка модель TTS, указанную выше, например ru → elevenlabs/eleven-multilingual-v2; без голоса другая модель OpenRouter берёт свой первый голос для этого языка.",
265
+ "Language (e.g. ru)": "Язык (например, ru)",
266
+ "TTS model (optional)": "Модель TTS (необязательно)",
267
+ "Voice (optional)": "Голос (необязательно)",
268
+ "Test": "Тест"
266
269
  }
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "Перевірити ffmpeg",
231
231
  "Download ffmpeg": "Завантажити ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "Завантажує статичний ffmpeg (ffmpeg-static, 20–30 МБ) до каталогу даних екземпляра. Використовується, якщо шлях не вказано.",
233
- "ai-parakeet (local adapter)": "ai-parakeet (локальний адаптер)",
234
- "ai-parakeet instance": "Екземпляр ai-parakeet",
235
- "Install ai-parakeet": "Встановити ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice (локальний адаптер)",
234
+ "ioBroker.voice instance": "Екземпляр ioBroker.voice",
235
+ "Install ioBroker.voice": "Встановити ioBroker.voice",
236
236
  "Install pi-agent": "Встановити pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "Адаптер pi-agent буде встановлено на хост цього екземпляра, і буде створено його екземпляр. Це займе кілька хвилин. Потім виберіть модель у його налаштуваннях або використайте загальносистемні налаштування ШІ в admin.",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ai-parakeet буде встановлено на хост цього екземпляра, і буде створено його екземпляр. Це займе кілька хвилин. Під час першого запуску він завантажить мовну модель (близько 670 МБ); потім йому потрібно близько 1,1 ГБ пам'яті.",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "Адаптер ioBroker.voice буде встановлено на хост цього екземпляра, і буде створено його екземпляр. Це займе кілька хвилин. Під час першого запуску він завантажить мовну модель (близько 670 МБ); потім йому потрібно близько 1,1 ГБ пам'яті.",
239
239
  "Install": "Встановити",
240
240
  "Cancel": "Скасувати",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s встановлено та вибрано. Збережіть налаштування, щоб ним користуватися.",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s вже встановлено, і тепер його вибрано. Збережіть налаштування, щоб ним користуватися.",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ai-parakeet розпізнає мовлення офлайн на процесорі свого хоста, 25 європейськими мовами, які модель визначає сама. Аудіо йде до нього через шину повідомлень ioBroker, тож екземпляр може працювати й на іншому хості.",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "Адаптер ioBroker.voice розпізнає мовлення офлайн на процесорі свого хоста, 25 європейськими мовами, які модель визначає сама. Аудіо йде до нього через шину повідомлень ioBroker, тож екземпляр може працювати й на іншому хості.",
244
244
  "Local model URL (GGUF, old setting)": "URL локальної моделі (GGUF, старе налаштування)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "Використовується, лише поки на вкладці «Локальні моделі» не вибрано модель. Краще виберіть модель там.",
246
246
  "Local models": "Локальні моделі",
@@ -261,6 +261,9 @@
261
261
  "Status": "Стан",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Voice per answer language",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Language (e.g. ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). Модель (лише OpenAI та OpenRouter) замінює для цієї мови модель TTS, вказану вище, наприклад ru → elevenlabs/eleven-multilingual-v2; без голосу інша модель OpenRouter бере свій перший голос для цієї мови.",
265
+ "Language (e.g. ru)": "Language (e.g. ru)",
266
+ "TTS model (optional)": "Модель TTS (необов'язково)",
267
+ "Voice (optional)": "Голос (необов'язково)",
268
+ "Test": "Тест"
266
269
  }
@@ -230,17 +230,17 @@
230
230
  "Check ffmpeg": "检查 ffmpeg",
231
231
  "Download ffmpeg": "下载 ffmpeg",
232
232
  "Downloads a static ffmpeg (ffmpeg-static, 20-30 MB) into the data directory of the instance. It is used when no path is entered.": "将静态 ffmpeg(ffmpeg-static,20–30 MB)下载到实例的数据目录。未填写路径时使用它。",
233
- "ai-parakeet (local adapter)": "ai-parakeet(本地适配器)",
234
- "ai-parakeet instance": "ai-parakeet 实例",
235
- "Install ai-parakeet": "安装 ai-parakeet",
233
+ "ioBroker.voice (local adapter)": "ioBroker.voice(本地适配器)",
234
+ "ioBroker.voice instance": "ioBroker.voice 实例",
235
+ "Install ioBroker.voice": "安装 ioBroker.voice",
236
236
  "Install pi-agent": "安装 pi-agent",
237
237
  "This installs the adapter pi-agent on the host of this instance and creates an instance of it. It takes a few minutes. Afterwards choose its model in its settings, or use the system-wide AI settings of admin.": "这会在本实例所在的主机上安装适配器 pi-agent 并创建一个实例。需要几分钟。之后请在其设置中选择模型,或使用 admin 的系统级 AI 设置。",
238
- "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "这会在本实例所在的主机上安装适配器 ai-parakeet 并创建一个实例。需要几分钟。首次启动时它会下载语音模型(约 670 MB),之后需要约 1.1 GB 内存。",
238
+ "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.": "这会在本实例所在的主机上安装适配器 ioBroker.voice 并创建一个实例。需要几分钟。首次启动时它会下载语音模型(约 670 MB),之后需要约 1.1 GB 内存。",
239
239
  "Install": "安装",
240
240
  "Cancel": "取消",
241
241
  "%s was installed and selected. Save the settings to use it.": "%s 已安装并选中。保存设置后即可使用。",
242
242
  "%s is already installed and is now selected. Save the settings to use it.": "%s 已经安装,现已选中。保存设置后即可使用。",
243
- "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "适配器 ai-parakeet 在其主机的 CPU 上离线识别语音,支持 25 种欧洲语言,语言由模型自动识别。音频通过 ioBroker 消息总线发送给它,因此该实例也可以运行在另一台主机上。",
243
+ "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.": "适配器 ioBroker.voice 在其主机的 CPU 上离线识别语音,支持 25 种欧洲语言,语言由模型自动识别。音频通过 ioBroker 消息总线发送给它,因此该实例也可以运行在另一台主机上。",
244
244
  "Local model URL (GGUF, old setting)": "本地模型 URL(GGUF,旧设置)",
245
245
  "Used only while no model is selected in the tab \"Local models\". Pick the model there instead.": "仅在“本地模型”选项卡中未选择模型时使用。请在那里选择模型。",
246
246
  "Local models": "本地模型",
@@ -261,6 +261,9 @@
261
261
  "Status": "状态",
262
262
  "ffmpeg": "ffmpeg",
263
263
  "Voice per answer language": "Voice per answer language",
264
- "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
265
- "Language (e.g. ru)": "Language (e.g. ru)"
264
+ "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). 模型(仅限 OpenAI 和 OpenRouter)会替换上方该语言的 TTS 模型,例如 ru → elevenlabs/eleven-multilingual-v2;未填写声音时,另一个 OpenRouter 模型会使用其该语言的第一个声音。",
265
+ "Language (e.g. ru)": "Language (e.g. ru)",
266
+ "TTS model (optional)": "TTS 模型(可选)",
267
+ "Voice (optional)": "声音(可选)",
268
+ "Test": "测试"
266
269
  }
@@ -963,7 +963,7 @@
963
963
  { "label": "Azure Speech", "value": "azure" },
964
964
  { "label": "AWS Transcribe", "value": "aws" },
965
965
  { "label": "Vosk (local)", "value": "vosk" },
966
- { "label": "ai-parakeet (local adapter)", "value": "parakeet" }
966
+ { "label": "ioBroker.voice (local adapter)", "value": "parakeet" }
967
967
  ],
968
968
  "default": "openai",
969
969
  "hidden": "!data.voiceEnabled",
@@ -1003,7 +1003,7 @@
1003
1003
  { "label": "Azure Speech", "value": "azure" },
1004
1004
  { "label": "AWS Transcribe", "value": "aws" },
1005
1005
  { "label": "Vosk (local)", "value": "vosk" },
1006
- { "label": "ai-parakeet (local adapter)", "value": "parakeet" }
1006
+ { "label": "ioBroker.voice (local adapter)", "value": "parakeet" }
1007
1007
  ],
1008
1008
  "default": "",
1009
1009
  "hidden": "!data.voiceEnabled",
@@ -1050,8 +1050,8 @@
1050
1050
  "parakeetInstance": {
1051
1051
  "newLine": true,
1052
1052
  "type": "instance",
1053
- "adapter": "ai-parakeet",
1054
- "label": "ai-parakeet instance",
1053
+ "adapter": "voice",
1054
+ "label": "ioBroker.voice instance",
1055
1055
  "hidden": "!data.voiceEnabled || (data.sttProvider !== 'parakeet' && data.sttFallback !== 'parakeet')",
1056
1056
  "xs": 12,
1057
1057
  "sm": 6,
@@ -1061,15 +1061,15 @@
1061
1061
  },
1062
1062
  "_installParakeet": {
1063
1063
  "type": "sendTo",
1064
- "label": "Install ai-parakeet",
1064
+ "label": "Install ioBroker.voice",
1065
1065
  "command": "installAdapter",
1066
- "jsonData": "{\"adapter\":\"ai-parakeet\"}",
1066
+ "jsonData": "{\"adapter\":\"voice\"}",
1067
1067
  "useNative": true,
1068
1068
  "showProcess": true,
1069
1069
  "variant": "outlined",
1070
1070
  "confirm": {
1071
- "title": "Install ai-parakeet",
1072
- "text": "This installs the adapter ai-parakeet on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.",
1071
+ "title": "Install ioBroker.voice",
1072
+ "text": "This installs the adapter ioBroker.voice on the host of this instance and creates an instance of it. It takes a few minutes. On its first start it downloads the speech model (about 670 MB); it then needs about 1.1 GB of memory.",
1073
1073
  "ok": "Install",
1074
1074
  "cancel": "Cancel"
1075
1075
  },
@@ -1087,7 +1087,7 @@
1087
1087
  "_parakeetInfo": {
1088
1088
  "newLine": true,
1089
1089
  "type": "staticText",
1090
- "text": "The adapter ai-parakeet recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.",
1090
+ "text": "The adapter ioBroker.voice recognises speech offline on the CPU of its host, in 25 European languages that the model detects itself. The audio goes to it over the ioBroker message bus, so the instance may also run on another host.",
1091
1091
  "hidden": "!data.voiceEnabled || (data.sttProvider !== 'parakeet' && data.sttFallback !== 'parakeet')",
1092
1092
  "xs": 12,
1093
1093
  "sm": 12,
@@ -1199,7 +1199,10 @@
1199
1199
  "xl": 4
1200
1200
  },
1201
1201
  "ttsModel": {
1202
- "type": "text",
1202
+ "type": "autocompleteSendTo",
1203
+ "command": "getTtsModels",
1204
+ "jsonData": "{\"ttsProvider\":\"openai\"}",
1205
+ "freeSolo": true,
1203
1206
  "label": "OpenAI TTS model (optional)",
1204
1207
  "help": "Empty = tts-1. Also: tts-1-hd, gpt-4o-mini-tts.",
1205
1208
  "hidden": "!data.voiceEnabled || data.ttsProvider !== 'openai'",
@@ -1498,7 +1501,7 @@
1498
1501
  "newLine": true,
1499
1502
  "type": "table",
1500
1503
  "label": "Voice per answer language",
1501
- "help": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS).",
1504
+ "help": "An answer in another language than the satellites listen in (e.g. pi-agent answers a Russian question in Russian) is spoken with the voice of its language, not spelled letter by letter by the voice above. Without a row the provider's default voice for that language is used. Voice names of the speech output provider, e.g. ru → ru_RU-dmitri-medium (Piper), ru-RU-SvetlanaNeural (Azure), Tatyana (AWS). The model (OpenAI and OpenRouter only) replaces the TTS model above for this language, e.g. ru → elevenlabs/eleven-multilingual-v2; without a voice another OpenRouter model takes its first voice for the language.",
1502
1505
  "hidden": "!data.voiceEnabled",
1503
1506
  "xs": 12,
1504
1507
  "sm": 12,
@@ -1506,8 +1509,61 @@
1506
1509
  "lg": 12,
1507
1510
  "xl": 12,
1508
1511
  "items": [
1509
- { "type": "text", "attr": "language", "title": "Language (e.g. ru)", "width": "30%" },
1510
- { "type": "text", "attr": "voice", "title": "Voice", "width": "70%" }
1512
+ {
1513
+ "type": "autocomplete",
1514
+ "attr": "language",
1515
+ "title": "Language (e.g. ru)",
1516
+ "width": "14%",
1517
+ "freeSolo": true,
1518
+ "options": [
1519
+ { "label": "en – English", "value": "en" },
1520
+ { "label": "de – Deutsch", "value": "de" },
1521
+ { "label": "ru – Русский", "value": "ru" },
1522
+ { "label": "uk – Українська", "value": "uk" },
1523
+ { "label": "fr – Français", "value": "fr" },
1524
+ { "label": "it – Italiano", "value": "it" },
1525
+ { "label": "es – Español", "value": "es" },
1526
+ { "label": "nl – Nederlands", "value": "nl" },
1527
+ { "label": "pl – Polski", "value": "pl" },
1528
+ { "label": "pt – Português", "value": "pt" },
1529
+ { "label": "cs – Čeština", "value": "cs" },
1530
+ { "label": "sv – Svenska", "value": "sv" },
1531
+ { "label": "tr – Türkçe", "value": "tr" },
1532
+ { "label": "el – Ελληνικά", "value": "el" },
1533
+ { "label": "zh – 中文", "value": "zh" },
1534
+ { "label": "ja – 日本語", "value": "ja" }
1535
+ ]
1536
+ },
1537
+ {
1538
+ "type": "autocompleteSendTo",
1539
+ "attr": "voice",
1540
+ "title": "Voice (optional)",
1541
+ "width": "38%",
1542
+ "command": "getVoices",
1543
+ "jsonData": "{\"ttsProvider\":\"${globalData.ttsProvider}\",\"language\":\"${data.language || globalData.voiceLanguage}\",\"openrouterTtsModel\":\"${data.model || globalData.openrouterTtsModel}\",\"voiceCredentialType\":\"${globalData.voiceCredentialType}\",\"voiceApiKey\":\"${globalData.voiceApiKey}\",\"voiceCredentialId\":\"${globalData.voiceCredentialId}\",\"azureSpeechKey\":\"${globalData.azureSpeechKey}\",\"azureSpeechRegion\":\"${globalData.azureSpeechRegion}\",\"azureCredentialId\":\"${globalData.azureCredentialId}\",\"awsAccessKeyId\":\"${globalData.awsAccessKeyId}\",\"awsSecretAccessKey\":\"${globalData.awsSecretAccessKey}\",\"awsRegion\":\"${globalData.awsRegion}\",\"awsCredentialId\":\"${globalData.awsCredentialId}\"}",
1544
+ "alsoDependsOn": ["language", "model"],
1545
+ "freeSolo": true
1546
+ },
1547
+ {
1548
+ "type": "autocompleteSendTo",
1549
+ "attr": "model",
1550
+ "title": "TTS model (optional)",
1551
+ "width": "38%",
1552
+ "command": "getTtsModels",
1553
+ "jsonData": "{\"ttsProvider\":\"${globalData.ttsProvider}\"}",
1554
+ "freeSolo": true
1555
+ },
1556
+ {
1557
+ "type": "custom",
1558
+ "attr": "_test",
1559
+ "title": "Test",
1560
+ "width": "10%",
1561
+ "i18n": true,
1562
+ "url": "custom/customComponents.js",
1563
+ "name": "ConfigCustomAssistant/Components/VoiceRowTestComponent",
1564
+ "bundlerType": "module",
1565
+ "guiApi": 2
1566
+ }
1511
1567
  ]
1512
1568
  },
1513
1569
  "_ffmpegPanel": {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Installs a helper adapter (pi-agent, ai-parakeet) and creates an instance of it, from a button in the settings.
3
+ * Installs a helper adapter (pi-agent, voice) and creates an instance of it, from a button in the settings.
4
4
  *
5
5
  * The host does it, as for the admin: `sendToHost(host, 'cmdExec', { id, data: 'add pi-agent' })` runs
6
6
  * `iobroker add pi-agent` there and reports back to this instance with the messages `cmdStdout`, `cmdStderr` and
@@ -1 +1 @@
1
- {"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/lib/installer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA0BH,sGAAsG;AACzF,QAAA,kBAAkB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC9C,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAEvC,MAAa,gBAAgB;IAMJ;IAEA;IACA;IARJ,OAAO,GAAG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C,IAAI,YAAY,GAAG,cAAc,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,yEAAyE;IACzE,IAAI;QACA,KAAK,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACxB,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;CACJ;AAlID,4CAkIC;AAED,iFAAiF;AACjF,SAAS,SAAS,CAAC,MAAqB;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5B,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,MAAM,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACrF,CAAC","sourcesContent":["/**\n * Installs a helper adapter (pi-agent, ai-parakeet) and creates an instance of it, from a button in the settings.\n *\n * The host does it, as for the admin: `sendToHost(host, 'cmdExec', { id, data: 'add pi-agent' })` runs\n * `iobroker add pi-agent` there and reports back to this instance with the messages `cmdStdout`, `cmdStderr` and\n * `cmdExit` (the last one twice, because it gets lost sometimes) — {@link AdapterInstaller.handleMessage} takes them.\n *\n * `add` installs from the repository the system uses and creates an instance. An adapter that is not in that\n * repository (pi-agent is only in \"latest\") comes from npm with `url iobroker.<name>`, then `add` once more.\n */\n\nexport interface InstallerAdapter {\n sendToHost(host: string, command: string, message: ioBroker.MessagePayload): void;\n getForeignObjectAsync(id: string): Promise<ioBroker.Object | null | undefined>;\n getObjectViewAsync(\n design: 'system',\n search: 'instance',\n params: { startkey: string; endkey: string },\n ): Promise<{ rows: { id: string; value: ioBroker.Object }[] }>;\n log: ioBroker.Logger;\n}\n\nexport interface CommandResult {\n /** Exit code of the command, null when it was killed. */\n code: number | null;\n /** Its last output lines. */\n output: string[];\n}\n\ninterface Running {\n resolve: (result: CommandResult) => void;\n output: string[];\n timer: NodeJS.Timeout;\n}\n\n/** An npm install on a Raspberry Pi takes a while; a command that runs longer goes on on the host. */\nexport const COMMAND_TIMEOUT_MS = 15 * 60_000;\nconst KEEP_LINES = 30;\nconst NAME_RE = /^[a-z0-9][a-z0-9-]*$/;\n\nexport class AdapterInstaller {\n private readonly running = new Map<string, Running>();\n private busy = '';\n private seq = 0;\n\n constructor(\n private readonly adapter: InstallerAdapter,\n /** Host to install on: the one of this instance. */\n private readonly host: string,\n private readonly timeoutMs = COMMAND_TIMEOUT_MS,\n ) {}\n\n /** A `cmdStdout`/`cmdStderr`/`cmdExit` message of the host; false when it is none of ours. */\n handleMessage(command: string, message: unknown): boolean {\n if (command !== 'cmdStdout' && command !== 'cmdStderr' && command !== 'cmdExit') {\n return false;\n }\n const { id, data } = (message || {}) as { id?: unknown; data?: unknown };\n const run = typeof id === 'string' ? this.running.get(id) : undefined;\n if (!run) {\n return true; // the second cmdExit, or a command of an earlier run\n }\n if (command === 'cmdExit') {\n this.running.delete(id as string);\n clearTimeout(run.timer);\n run.resolve({ code: typeof data === 'number' ? data : null, output: run.output });\n return true;\n }\n const text = typeof data === 'string' ? data : data === undefined || data === null ? '' : JSON.stringify(data);\n for (const line of text.split(/\\r?\\n/)) {\n if (line.trim()) {\n run.output.push(line.trim());\n this.adapter.log.debug(`${this.host}: ${line.trim()}`);\n }\n }\n run.output.splice(0, Math.max(0, run.output.length - KEEP_LINES));\n return true;\n }\n\n /** Run `iobroker <cmd>` on the host. */\n run(cmd: string): Promise<CommandResult> {\n const id = `assistant-${Date.now()}-${++this.seq}`;\n this.adapter.log.info(`${this.host}: iobroker ${cmd}`);\n return new Promise(resolve => {\n const timer = setTimeout(() => {\n this.running.delete(id);\n resolve({\n code: null,\n output: [\n `iobroker ${cmd} still runs on ${this.host} after ${Math.ceil(this.timeoutMs / 60_000)} min — see the log of the host`,\n ],\n });\n }, this.timeoutMs);\n this.running.set(id, { resolve, output: [], timer });\n this.adapter.sendToHost(this.host, 'cmdExec', { id, data: cmd });\n });\n }\n\n /** An instance of the adapter: an enabled one first, on this host first. `pi-agent.0`, or null. */\n async findInstance(name: string): Promise<string | null> {\n const prefix = `system.adapter.${name}.`;\n const view = await this.adapter.getObjectViewAsync('system', 'instance', {\n startkey: prefix,\n endkey: `${prefix}香`,\n });\n const rank = (obj: ioBroker.Object): number =>\n (obj.common?.enabled ? 0 : 2) + ((obj.common as { host?: string })?.host === this.host ? 0 : 1);\n const rows = (view?.rows || [])\n .filter(row => row.value && /^\\d+$/.test(row.id.slice(prefix.length)))\n .sort((a, b) => rank(a.value) - rank(b.value) || a.id.localeCompare(b.id, undefined, { numeric: true }));\n return rows.length ? rows[0].id.slice('system.adapter.'.length) : null;\n }\n\n /** Install the adapter if needed and create an instance if there is none. */\n async ensure(name: string): Promise<{ instance: string; installed: boolean }> {\n if (!NAME_RE.test(name)) {\n throw new Error(`Invalid adapter name \"${name}\"`);\n }\n const existing = await this.findInstance(name);\n if (existing) {\n return { instance: existing, installed: false };\n }\n if (this.busy) {\n throw new Error(`${this.busy} is being installed right now`);\n }\n this.busy = name;\n try {\n const installed = async (): Promise<boolean> =>\n !!(await this.adapter.getForeignObjectAsync(`system.adapter.${name}`));\n let add = await this.runToEnd(`add ${name}`);\n if (!(await this.findInstance(name))) {\n if (!(await installed())) {\n // not in the repository the system uses: the newest version from npm\n const npm = await this.runToEnd(`url iobroker.${name}`);\n if (!(await installed())) {\n throw new Error(\n `${name} could not be installed — neither from the repository (${lastError(add)}) nor from npm (${lastError(npm)})`,\n );\n }\n }\n add = await this.runToEnd(`add ${name}`);\n }\n const instance = await this.findInstance(name);\n if (!instance) {\n throw new Error(`${name} is installed, but no instance was created: ${lastError(add)}`);\n }\n this.adapter.log.info(`${instance} installed on ${this.host}`);\n return { instance, installed: true };\n } finally {\n this.busy = '';\n }\n }\n\n /** {@link run}, but a command that did not end (timeout, adapter stops) ends the installation: it still runs. */\n private async runToEnd(cmd: string): Promise<CommandResult> {\n const result = await this.run(cmd);\n if (result.code === null) {\n throw new Error(result.output[result.output.length - 1] || `iobroker ${cmd} did not end`);\n }\n return result;\n }\n\n /** Ends waiting commands (the adapter stops); they go on on the host. */\n stop(): void {\n for (const [id, run] of this.running) {\n clearTimeout(run.timer);\n run.resolve({ code: null, output: ['the adapter stopped'] });\n this.running.delete(id);\n }\n }\n}\n\n/** The line that says why a command failed: an error line, else the last one. */\nfunction lastError(result: CommandResult): string {\n const lines = result.output;\n const error = [...lines].reverse().find(line => /error|unknown|not found|cannot|failed/i.test(line));\n const line = error || lines[lines.length - 1] || '';\n return `exit code ${result.code ?? '–'}${line ? `: ${line.slice(0, 300)}` : ''}`;\n}\n"]}
1
+ {"version":3,"file":"installer.js","sourceRoot":"","sources":["../../src/lib/installer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA0BH,sGAAsG;AACzF,QAAA,kBAAkB,GAAG,EAAE,GAAG,MAAM,CAAC;AAC9C,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAEvC,MAAa,gBAAgB;IAMJ;IAEA;IACA;IARJ,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,IAAI,GAAG,EAAE,CAAC;IACV,GAAG,GAAG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;IAClB,CAAC;IAED,yEAAyE;IACzE,IAAI;QACA,KAAK,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACxB,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;CACJ;AAlID,4CAkIC;AAED,iFAAiF;AACjF,SAAS,SAAS,CAAC,MAAqB;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5B,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,wCAAwC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,MAAM,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACrF,CAAC","sourcesContent":["/**\n * Installs a helper adapter (pi-agent, voice) and creates an instance of it, from a button in the settings.\n *\n * The host does it, as for the admin: `sendToHost(host, 'cmdExec', { id, data: 'add pi-agent' })` runs\n * `iobroker add pi-agent` there and reports back to this instance with the messages `cmdStdout`, `cmdStderr` and\n * `cmdExit` (the last one twice, because it gets lost sometimes) — {@link AdapterInstaller.handleMessage} takes them.\n *\n * `add` installs from the repository the system uses and creates an instance. An adapter that is not in that\n * repository (pi-agent is only in \"latest\") comes from npm with `url iobroker.<name>`, then `add` once more.\n */\n\nexport interface InstallerAdapter {\n sendToHost(host: string, command: string, message: ioBroker.MessagePayload): void;\n getForeignObjectAsync(id: string): Promise<ioBroker.Object | null | undefined>;\n getObjectViewAsync(\n design: 'system',\n search: 'instance',\n params: { startkey: string; endkey: string },\n ): Promise<{ rows: { id: string; value: ioBroker.Object }[] }>;\n log: ioBroker.Logger;\n}\n\nexport interface CommandResult {\n /** Exit code of the command, null when it was killed. */\n code: number | null;\n /** Its last output lines. */\n output: string[];\n}\n\ninterface Running {\n resolve: (result: CommandResult) => void;\n output: string[];\n timer: NodeJS.Timeout;\n}\n\n/** An npm install on a Raspberry Pi takes a while; a command that runs longer goes on on the host. */\nexport const COMMAND_TIMEOUT_MS = 15 * 60_000;\nconst KEEP_LINES = 30;\nconst NAME_RE = /^[a-z0-9][a-z0-9-]*$/;\n\nexport class AdapterInstaller {\n private readonly running = new Map<string, Running>();\n private busy = '';\n private seq = 0;\n\n constructor(\n private readonly adapter: InstallerAdapter,\n /** Host to install on: the one of this instance. */\n private readonly host: string,\n private readonly timeoutMs = COMMAND_TIMEOUT_MS,\n ) {}\n\n /** A `cmdStdout`/`cmdStderr`/`cmdExit` message of the host; false when it is none of ours. */\n handleMessage(command: string, message: unknown): boolean {\n if (command !== 'cmdStdout' && command !== 'cmdStderr' && command !== 'cmdExit') {\n return false;\n }\n const { id, data } = (message || {}) as { id?: unknown; data?: unknown };\n const run = typeof id === 'string' ? this.running.get(id) : undefined;\n if (!run) {\n return true; // the second cmdExit, or a command of an earlier run\n }\n if (command === 'cmdExit') {\n this.running.delete(id as string);\n clearTimeout(run.timer);\n run.resolve({ code: typeof data === 'number' ? data : null, output: run.output });\n return true;\n }\n const text = typeof data === 'string' ? data : data === undefined || data === null ? '' : JSON.stringify(data);\n for (const line of text.split(/\\r?\\n/)) {\n if (line.trim()) {\n run.output.push(line.trim());\n this.adapter.log.debug(`${this.host}: ${line.trim()}`);\n }\n }\n run.output.splice(0, Math.max(0, run.output.length - KEEP_LINES));\n return true;\n }\n\n /** Run `iobroker <cmd>` on the host. */\n run(cmd: string): Promise<CommandResult> {\n const id = `assistant-${Date.now()}-${++this.seq}`;\n this.adapter.log.info(`${this.host}: iobroker ${cmd}`);\n return new Promise(resolve => {\n const timer = setTimeout(() => {\n this.running.delete(id);\n resolve({\n code: null,\n output: [\n `iobroker ${cmd} still runs on ${this.host} after ${Math.ceil(this.timeoutMs / 60_000)} min — see the log of the host`,\n ],\n });\n }, this.timeoutMs);\n this.running.set(id, { resolve, output: [], timer });\n this.adapter.sendToHost(this.host, 'cmdExec', { id, data: cmd });\n });\n }\n\n /** An instance of the adapter: an enabled one first, on this host first. `pi-agent.0`, or null. */\n async findInstance(name: string): Promise<string | null> {\n const prefix = `system.adapter.${name}.`;\n const view = await this.adapter.getObjectViewAsync('system', 'instance', {\n startkey: prefix,\n endkey: `${prefix}香`,\n });\n const rank = (obj: ioBroker.Object): number =>\n (obj.common?.enabled ? 0 : 2) + ((obj.common as { host?: string })?.host === this.host ? 0 : 1);\n const rows = (view?.rows || [])\n .filter(row => row.value && /^\\d+$/.test(row.id.slice(prefix.length)))\n .sort((a, b) => rank(a.value) - rank(b.value) || a.id.localeCompare(b.id, undefined, { numeric: true }));\n return rows.length ? rows[0].id.slice('system.adapter.'.length) : null;\n }\n\n /** Install the adapter if needed and create an instance if there is none. */\n async ensure(name: string): Promise<{ instance: string; installed: boolean }> {\n if (!NAME_RE.test(name)) {\n throw new Error(`Invalid adapter name \"${name}\"`);\n }\n const existing = await this.findInstance(name);\n if (existing) {\n return { instance: existing, installed: false };\n }\n if (this.busy) {\n throw new Error(`${this.busy} is being installed right now`);\n }\n this.busy = name;\n try {\n const installed = async (): Promise<boolean> =>\n !!(await this.adapter.getForeignObjectAsync(`system.adapter.${name}`));\n let add = await this.runToEnd(`add ${name}`);\n if (!(await this.findInstance(name))) {\n if (!(await installed())) {\n // not in the repository the system uses: the newest version from npm\n const npm = await this.runToEnd(`url iobroker.${name}`);\n if (!(await installed())) {\n throw new Error(\n `${name} could not be installed — neither from the repository (${lastError(add)}) nor from npm (${lastError(npm)})`,\n );\n }\n }\n add = await this.runToEnd(`add ${name}`);\n }\n const instance = await this.findInstance(name);\n if (!instance) {\n throw new Error(`${name} is installed, but no instance was created: ${lastError(add)}`);\n }\n this.adapter.log.info(`${instance} installed on ${this.host}`);\n return { instance, installed: true };\n } finally {\n this.busy = '';\n }\n }\n\n /** {@link run}, but a command that did not end (timeout, adapter stops) ends the installation: it still runs. */\n private async runToEnd(cmd: string): Promise<CommandResult> {\n const result = await this.run(cmd);\n if (result.code === null) {\n throw new Error(result.output[result.output.length - 1] || `iobroker ${cmd} did not end`);\n }\n return result;\n }\n\n /** Ends waiting commands (the adapter stops); they go on on the host. */\n stop(): void {\n for (const [id, run] of this.running) {\n clearTimeout(run.timer);\n run.resolve({ code: null, output: ['the adapter stopped'] });\n this.running.delete(id);\n }\n }\n}\n\n/** The line that says why a command failed: an error line, else the last one. */\nfunction lastError(result: CommandResult): string {\n const lines = result.output;\n const error = [...lines].reverse().find(line => /error|unknown|not found|cannot|failed/i.test(line));\n const line = error || lines[lines.length - 1] || '';\n return `exit code ${result.code ?? '–'}${line ? `: ${line.slice(0, 300)}` : ''}`;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Messages that reach `onMessage` but are no request.
4
+ *
5
+ * js-controller hands a reply (`callback.ack`) to the callback that waits for it; when that callback is gone, the reply
6
+ * arrives as a message of its own. That happens when the adapter restarted while another adapter was still answering
7
+ * it: a pi-agent answer that comes after an update of the assistant. Answering such a reply sends it back with the same
8
+ * `callback`, and a caller that does the same keeps both adapters in a loop (field report 2026-11-13: about 25 empty
9
+ * `ask` a second between assistant.0 and pi-agent.0 after an update of the assistant).
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.isLateReply = isLateReply;
13
+ /** Whether the message is a late reply to a request of ours rather than a request. */
14
+ function isLateReply(obj) {
15
+ return !!obj?.callback?.ack;
16
+ }
17
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/lib/messages.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAGH,kCAEC;AAHD,sFAAsF;AACtF,SAAgB,WAAW,CAAC,GAA+D;IACvF,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC;AAChC,CAAC","sourcesContent":["/**\n * Messages that reach `onMessage` but are no request.\n *\n * js-controller hands a reply (`callback.ack`) to the callback that waits for it; when that callback is gone, the reply\n * arrives as a message of its own. That happens when the adapter restarted while another adapter was still answering\n * it: a pi-agent answer that comes after an update of the assistant. Answering such a reply sends it back with the same\n * `callback`, and a caller that does the same keeps both adapters in a loop (field report 2026-11-13: about 25 empty\n * `ask` a second between assistant.0 and pi-agent.0 after an update of the assistant).\n */\n\n/** Whether the message is a late reply to a request of ours rather than a request. */\nexport function isLateReply(obj: { callback?: { ack?: boolean } | null } | null | undefined): boolean {\n return !!obj?.callback?.ack;\n}\n"]}